JSFiddle - React, Tailwind, and code Playground
by Eric Howe
HTML
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone-min.js"></script>
JavaScript
var M = Backbone.Model.extend({ });
var C = Backbone.Collection.extend({
model: M,
parse: function(response) {
_(response).each(function(m) { m.new_thing = 11 });
return response;
}
});
var c = new C(
C.prototype.parse([
{ where_is: 'pancakes house?' },
{ where_is: 'parse called?' }
])
);
console.log(_(c.models).pluck('attributes'));