Is there a callback for when underscore is finished it's _.each
loop because if I console log
immediately afterwards obviously the array I am populating with the each loop is not available. This is from a nested _.each
loop.
_.each(data.recipe, function(recipeItem) {
var recipeMap = that.get('recipeMap');
recipeMap[recipeItem.id] = { id: recipeItem.id, quantity: recipeItem.quantity };
});
console.log(that.get('recipeMap')); //not ready yet.
See Question&Answers more detail:os