Typescript Loop Through Array With Division