I have a large, multidimensional array of JSON objects that I want to map through (using Underscore). For example:
var dummyData = [
[{title: 'a'},{title : 'b'}],
[{title: 'a'},{title : 'b'}],
[{title: 'a'},{title : 'b'}],
[{title: 'a'},{title : 'b'}]
];
For the function body of the _.map, I want to run each JSON object through a Backbone Model constructor. So far, I've tried something like this to accomplish this:
_.map(dummyData, function() {
_.each(dummyData, function(el, i) {
// run each object through the constructor
}
})
I'm getting caught up on the _.each, though - since dummyData isn't actually the 'list' that I want to loop through.
Or am I thinking about this wrong altogether?