Typescript Type In Array Javascript Iterations