If I run this, I will get 1, 2, ..., 50 in my console.
keys = [1, 2, 3, ..., 50];
async.forEach(keys, function (key, callback){
console.log(key);
callback();
}
But I want to have an step of 3. I want to get: 1, 4, 7, ... like this for loop:
for (let key = 1; key <= 50; key = key + 3) {
}
How can I achieve this with async?
keysis set to[1, 2, 3...initially, just multiply by 3 and subtract to get to1, 4, 7on each iteration? Is that what you mean?