So I have an array like the one in the code below, and I would want to sort it on height. So that the shortest person will log when I do console.log(array[0]);
I have no idea how to do so
let array = [
{
name: "John",
gender: "male",
height_meters: 1.8
},
{
name: "Cathrine",
gender: "female",
height_meters: 1.7
}
]