Last active
November 10, 2015 04:45
-
-
Save Teino1978-Corp/6f33463b46dbeec6f469 to your computer and use it in GitHub Desktop.
Applying context of functions to javascript variable
This file contains hidden or 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 foo = { | |
a: function() { | |
alert(this.a); | |
}, | |
b: function() { | |
this._b +=; | |
alert (this._b); | |
} | |
var moo = new Something(); // some object | |
var moo.func.foo = foo; // right now this is moo.func | |
var moo; | |
Something.prototype = foo; | |
moo = new Something(); | |
moo.a(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment