JSFiddle - React, Tailwind, and code Playground

by vineet85

HTML

<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script src="http://dl.dropbox.com/u/16292713/js/backbone.js"></script>
<script src="http://dl.dropbox.com/u/16292713/js/underscore.js"></script>

JavaScript

var Vehicle = Backbone.Model.extend({});

var Vehicles = Backbone.Collection.extend({
    model: Vehicle,
    comparator: function(vehicle){
        return vehicle.get('sequence');
    }
});

var vehicles = new Vehicles([
    new Vehicle({color:'red', sequence:2}),
    new Vehicle({color:'green', sequnce:1})
    ]);

console.log(JSON.stringify(vehicles));