I am looking to extract the highest and lowest values from specific data points within a nested array.
For example, this nested array is structured as [latitude, longitude].
The specific nested array in question looks like this: [[40, 50], [50, 60], [60, 70]].
When it comes to longitude, the maximum value should be 70 and the minimum should be 50.
As for latitude, the maximum value should be 60 and the minimum should be 40.
To find the average longitude value, you should get 60, while for average latitude it would be 50.
So my query now is how can I use JavaScript to identify the maximum and minimum longitude and latitude values separately within the nested array, and then calculate their averages?