I'm reading a book on rapid prototyping in JS. There is this line of code:
var appleModel = this.collection.where({name: appleName})[0];
I know where()
returns matching models in the collection. But what does the [0]
at the end do?
I'm reading a book on rapid prototyping in JS. There is this line of code:
var appleModel = this.collection.where({name: appleName})[0];
I know where()
returns matching models in the collection. But what does the [0]
at the end do?