Create New Array From Existing Array Typescript Vs Javascript