If I have this in javascript
var x = {
"a" : function(q) { return q+1; },
"b" : function(w) { return (this["a"])(1); }
};
I want to do something, like access functions from the same object but different properties.
For example, in the above code, property a
should be fine, but in property b
, I want to use the function stored in a
. Currently for fun I just have this["a"]
which probably doesn't work. But is there a way I can get that function?
Thanks