Created
November 25, 2011 01:44
-
-
Save masahitojp/1392628 to your computer and use it in GitHub Desktop.
arguments.calleeの代わりに名前付き関数を使う
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 test(n){ | |
"use strict"; | |
if(n==0){ | |
return 1; | |
}else{ | |
// return arguments.callee(n-1); <= strictモードではエラー | |
return n* test(n-1); // 名前付き関数を使う。 | |
} | |
})(2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment