Skip to content

Instantly share code, notes, and snippets.

@Plou
Created January 20, 2015 14:22
Show Gist options
  • Save Plou/4a6b3722249e79ea35d2 to your computer and use it in GitHub Desktop.
Save Plou/4a6b3722249e79ea35d2 to your computer and use it in GitHub Desktop.
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