This is so strange.
I do
console.log(this.collection);
And I can see all my models fine with its IDs attached correctly.
But on the same line, I do
console.log(this.collection.get(1));
And it tells me it’s “undefined”.
What’s going on?
EDIT : Just wondering, does “id” have to be unique? I have some models that have no “ids” and then others have IDs set. Does this matter?
You have to
at(1)instead ofget(1),get()is looking for an element by id in the collection whileat()is looking at a position.