I have an array of objects - http://api.openweathermap.org/data/2.5/forecast?q=london&appid=7ce3e1102e1902e0f878c2a640e95aed
How can I create three new arrays (seperate variable names) in JavaScript that will contain "dt", "temp_min" and "temp_max" only in a format of:
dtArray = [firstvalue, secondvalue, thirdvalue, ...]
tempMinArray = [firstvalue, secondvalue, thirdvalue, ...]
tempMaxArray = [firstvalue, secondvalue, thirdvalue, ...]
Do I loop ? Or use map? each? And how?
My poor attempt:
var tempMinArray = new Array;
for (i = 0; i < results.data.length; i++ ) {
tempMinArray = results.data.list[i].main.temp_min;
}