This is obviously an extremely simplified code snippet, but my code base is being held up with something that this example is set to mimic.
When I try to log the current for-loop index from within an async.waterfall function, I get 2. 2 is the number of total elements in my array, but of course the indices should be 0 and 1. I've effectively used async.MAP within a for-loop in the past, so I'm not sure why this async function is not working. Thanks for any help with this matter or on the topic of nesting async-library functions.
var objects = [
{objectName: "hello",
objectPurposes: ["demo"]},
{objectName: "goodbye",
objectPurposes: ["demo", "fun"]}];
for (var i=0; i<objects.length; i++){
async.waterfall([
function(callback){
console.log(i);
}
])
}