JSFiddle - React, Tailwind, and code Playground
by Cody Lindley
HTML
<script src="https://dl.dropboxusercontent.com/u/2026291/backbone/jquery-2.0.2.js"></script>
<script src="https://dl.dropboxusercontent.com/u/2026291/backbone/lodash.underscore.js"></script>
<script src="https://dl.dropboxusercontent.com/u/2026291/backbone/backbone.js"></script>
<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
JavaScript
//create contact model, no change event is fired when model is instantiated with data
var contact=new Backbone.Model({firstName:'John',lastName:'Doe',phone:'111-111-1111'});
//make a change
contact.set({phone:'2-222-2222',firstName:'Jane'});
//get previous value for phone
console.log(contact.previous('phone')); //logs 111-111-1111
//get the state of all attributes prior to last change event
console.log(contact.previousAttributes()); //logs {firstName:"John",lastName:"Doe",phone:"111-111-1111"}