Created
January 20, 2015 14:22
-
-
Save Plou/4a6b3722249e79ea35d2 to your computer and use it in GitHub Desktop.
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
function Class(variante) { | |
this.methods[variante] | |
return this; | |
} | |
Class.prototype.bar = function(a, b) { | |
return a + b; | |
}; | |
Class.prototype.methods = { | |
bim: function() { | |
// Que vaut 'this' ici ? | |
return 'bim'; | |
}, | |
foo: function() { | |
// Comment appeler la methode 'bar' ici | |
return 'foo'; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment