Javascript Max Value From An Array Of Shapes