Created
July 2, 2010 20:12
-
-
Save efleming969/461849 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
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