Backbone.js is a library for Javascript which uses MVC model . 

there are three main elements of backbone.js 

1) Backbone.Model   : Singular of data , ( traditionally one row in table ) 

2)Backbone.Collection  : Plural of data , ( data which has something in common , combined logically ) . 

3)Backbone.View  : 

           a)should be a visual representation of your data

           b)should provide editing functionality for individual models ( optional)

Defining Model :

var Model = Backbone.Model.extend();

We now have a Model class , we can instantiate it using traditional new . 

var model1 = new Model({label:"test label"}); 

Models have attributes , which are manipulated in two ways : 

model1.set({label: ‘Item 1’, order: 1});


Note : The attributes cannot be read / written using model.attribute_name ( traditional js way ) .

In above example model1 has a single attribute Label , whose value is "test label"

Defining Collection:

Having defined how one data item looks like, you can continue to creating the definition and possible and instance of how several items look:

// Definition, tell it what king of items it will contain
var Models = Backbone.Collection.extend({model:Model});
// Create a models instance with two example items in it (we pretend
// that the JSON list comes from a server:
var models = new Models([ {id: ‘m1′, label:’Item 1’},
                          {id: ‘m2′, label:’Item 2’} ]);

Defining Views : 

Model /collections can then be attached to views

View = Backbone.View.extend({
    // shortened for brevity..