Creating An Object Array Typescript Vs Javascript