Javascript New Object Array Typescript Interview Question