Hacker News new | past | comments | ask | show | jobs | submit login
Anonymous recursion in 6 lines of Javascript (aurlien.net)
1 point by arnemart on Jan 21, 2011 | hide | past | favorite | 1 comment



Seems like a somewhat convoluted way of doing this:

  alert(function rec(i) {
    return i === 0 ? 1 : i * rec(i - 1);
  }(4));//24
  alert(typeof rec);//undefined




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: