Skip to content

Instantly share code, notes, and snippets.

@KOBA789
Created July 2, 2012 14:50
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save KOBA789/3033621 to your computer and use it in GitHub Desktop.
Save KOBA789/3033621 to your computer and use it in GitHub Desktop.
あなたがJavaScriptを嫌いになるのに十分なコード
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