Javascript New Object Array Iterator Javascript Interview Question