Jdi*_*zle 2 javascript where backbone.js
我正在读一本关于JS快速原型制作的书.这行代码:
var appleModel = this.collection.where({name: appleName})[0];
我知道where()在集合中返回匹配的模型.但到底是[0]做什么的呢?
where()
[0]
idb*_*old 8
Backbone的.where()函数返回一个模型数组.将[0]在年底只是需要返回的第一款车型.where().
.where()
归档时间:
12 年,12 月 前
查看次数:
8420 次
最近记录:
12 年,1 月 前