Typescript Array With Key Value Javascript Map Vs Foreach