Created
July 2, 2012 14:50
-
-
Save KOBA789/3033621 to your computer and use it in GitHub Desktop.
あなたがJavaScriptを嫌いになるのに十分なコード
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 (bar) { | |
this.foo = bar; | |
} | |
Class.prototype.method = function () { | |
return this.foo; | |
}; | |
var instance = new Class('baz'), | |
func = instance.method; | |
console.log(instance.method()); | |
console.log(func()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment