JSFiddle - React, Tailwind, and code Playground
by moeishaa
HTML
<script src="http://documentcloud.github.com/underscore/underscore.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone.js"></script>
JavaScript
var Person = Backbone.Model.extend({
initialize: function () {
this.set('fullName', this.get('firstName') + ' ' + this.get('lastName'));
},
defaults: {
firstName: '',
lastName: ''
}
});
var p = new Person({
firstName: 'Moe',
lastName: 'Hosseini'
});
console.log(p.get('fullName'));