I need to find the max value (b) of the array then take that value convert it then put everything into another function and display it like so: "Lake Baikal:1640.43 meters."
function lakeDepth() {
let lakeData = {
"Caspian Sea": 560,
"Tarn Hows": 53,
"Crater Lake": 324,
"Lake Tanganyika": 803,
"Lake Vostok": 546,
"Lake Baikal": 897,
};
result = Object
.keys(lakeData)
.sort(function(a, b) {
return lakeData[b] - lakeData[a];
})
.map(Number);
console.log(result);
}
lakeDepth();
function fathomsToMeter() {
let deepestInMeter = result * 1.8288;
return deepestInMeter;
}
function displayData() {
console.log(result + deepestInMeter + "meter");
}
how do i get just the "b" part of the array do the calculation in the function and put it together at the end? thanks in advance for any help.