在打印集合中的模型时,我看到两个“未定义”列表context
和collection
,它们与我的骨干集合具有相同的长度,我想知道它们的用途。
var collection = new Backbone.Collection([{x:1},{x:2},{x:3}]);
print(collection.at(0));
{
_callbacks: {
all: {
next: {
callback: function (event, model, collection, options) {...},
context: [undefined, undefined, undefined],
next: {}
},
tail: {}
}
},
_escapedAttributes: {},
_pending: {},
_previousAttributes: {x: 1},
_silent: {},
attributes: {x: 1},
changed: {},
cid: "c11",
collection: [undefined, undefined, undefined]
}