Javascript Loop Array Of Objects And Attributes Of Shapes