In comments is output. This is javascript bug, backbone or other?
var t = Backbone.View.extend({
ben: {},
banana: function(s){
this.ben[s] = s;
},
show: function(){
console.info(this.ben)
}
});
var c1 = new t();
var c2 = new t();
c1.banana('1');
c1.show(); //Object { 1="1"}
c2.banana('2');
c1.show(); //Object { 1="1", 2="2"}
The code is behaving as expected (i.e. not a bug).
benis added to the prototype.Consider doing this instead: