I have an array that looks likes this
[ { length: 5.6, width: 5.1, height: 5.3 }, { length: 7.7, width: 6.4, height: 6.5 } ] I need to reorder each object to different keys based on criteria of the largest number in each object is length, second largest width, smallest height. what would be the best way to do this? Is there a way to do a comparison inside of map function to find the largest of the 3 values and set it to length the smallest set it to height and the one left set to width?
[ { length: 5.6, width: 5.3, height: 5.1 }, { length: 7.7, width: 6.5, height: 6.4 } ]