I\'m just learning backbone. I have the following
window.ServerList = Backbone.Collection.extend({ model: Server, cpuTotal: function(){ if
Here is the best way I know how:
cpuTotal: function() { return this.reduce(function(memo, value) { return memo + value.get("cpu") }, 0); }
Here is a jsFiddle of the solution.