Skip to content

Instantly share code, notes, and snippets.

@efleming969
Created July 2, 2010 20:12
Show Gist options
  • Save efleming969/461849 to your computer and use it in GitHub Desktop.
Save efleming969/461849 to your computer and use it in GitHub Desktop.
var MyObject = function(ctor) {
var $this = this;
this.foo = function() {
console.log("foo called");
}
this.bar = function() {
$this.foo();
}
};
function MyClass(name) {
this.name = name;
this.$this = this;
}
MyClass.prototype.foo = function() {
console.log("foo called");
}
MyClass.prototype.bar = function() {
$this.foo();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment