I have an object:
var sampleArray = [["name1", "age1"], ["name2", "age2"],["name3", "age3"]];
async.mapSeries(sampleArray[names], sampleFunction(), function(err, result) {
console.log(result);
});//sample code //["name1","name2","name3"] executes here
async.mapSeries(sampleArray[ages], sampleFunction(), function(err, result) {
console.log(result);
});//sample code //["age1","age2","age3"] executes here
This is my sample code, here I want to achieve first time all the "name" properties got executed in samplefunction and on the second iteration all the "age" properties.
How to achieve that ?
sampleArray[names]would return undefined... it's an array you cannot access it this way.