0
在下劃線_.each中,是否有任何方法將使用命名函數作爲迭代器並將其傳遞給參數?將參數傳遞給下劃線中的被命名的Iteratee。每個
parseItems: function() {
return _.each(this.items, this.parseItem(item), this);
}
還是我必須做這樣的:
parseItems: function() {
return _.each(this.items, function(item) {
this.parseItem(item);
}, this);
}
真棒,謝謝 – cantera