13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

アロー関数で自己再帰@ES6

Last updated at Posted at 2014-07-24

ECMAScirpt6で導入予定のアロー関数とデフォルト引数を組合せた自己再帰関数。

var fact = ((f=n=>n>1?n*f(n-1):1)=>f)();
fact(5); //== 120

引用元
http://d.hatena.ne.jp/teramako/20130321/p1
http://www.mail-archive.com/es-discuss@mozilla.org/msg22135.html

13
13
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?