javascript - How to call a sibling method in an object defined with object syntax? -
how this?
var obj = { func1 : function(){ // stuff }, func2 : function(){ func1(); // not work this.func1(); // not work } } edit: missed semicolon
var obj = { func1 : function(){ // stuff }, func2 : function(){ obj.func1(); // works fine } }
Comments
Post a Comment