new to Backbone and underscore js here.
I have an array of arrays that I want to convert to a collection of models.
So it's like
{ {1, 2, 3, 4}, {5, 6, 7, 8}}
The second level of arrays is what's going into a backbone model. Right now, I have
collection.reset(_.map(results, (indvidualResults) -> new model(individualResults))
Which doesn't work as when I do a console.log(collection.pop) I get a function printed out. I think this is because I'm working with an array of arrays (but I could be wrong). How do I convert the second array into a model and then put that into a collection?
_.mapwhenCollection#resetwill do all that for you? (3) Collections have apopmethod so of courseconsole.log(collection.pop)gives you a function.console.log(collection.pop())?console.log(collection.pop)*should* give you a function.