Looking to parse through an array of objects related to London weather data from the OpenWeatherMap API.
How can I create three distinct arrays in JavaScript, each with variable names "dtArray", "tempMinArray", and "tempMaxArray", containing only values for "dt", "temp_min", and "temp_max" respectively in the following format:
dtArray = [firstvalue, secondvalue, thirdvalue, ...]
tempMinArray = [firstvalue, secondvalue, thirdvalue, ...]
tempMaxArray = [firstvalue, secondvalue, thirdvalue, ...]
Should I utilize a loop, or is there another method like map or each that would be more efficient?
My current attempt:
var tempMinArray = new Array;
for (i = 0; i < results.data.length; i++) {
tempMinArray = results.data.list[i].main.temp_min;
}