Typescript Iterate Through Array Javascript Length