下划线完成时是否有回调,它是_.each
循环,因为如果我console log
之后立即显然我用每个循环填充的数组不可用。这是来自嵌套_.each
循环。
_.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.