Created
April 24, 2012 04:53
-
-
Save yoko/2476547 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
function foo(type) { | |
return type ? | |
function() { | |
return console.log(type); | |
} : | |
console.log(this.toString()); | |
} | |
foo('foo')(); // コールバックで使う | |
foo.call('foo'); // 単独で使う |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment