Typescript Iterate Through Array Python Memory