Created
May 16, 2012 11:45
-
-
Save knowtheory/2709760 to your computer and use it in GitHub Desktop.
Backbone confusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var test = Backbone.Model.extend({ | |
var1 : [], | |
initialize : function(obj) { | |
this.var1.push("1") | |
console.log(this.var1.length, this.cid) | |
} | |
}); | |
var x = (new test); | |
var y = (new test); | |
1 "c37" | |
2 "c38" | |
//expecting length of 1 each time | |
var test = Backbone.Model.extend({ | |
var1 : [], | |
initialize : function(obj) { | |
this.var1.push("1") | |
console.log(this.var1.length, this.cid) | |
} | |
}); | |
var x = new test() | |
var y = new test() | |
1 "c39" | |
2 "c40" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment