Typescript Loop Through Object Attributes Javascript