Hacker News new | past | comments | ask | show | jobs | submit login

>> "If you want a function to call itself..."

Or just use the arguments.callee property which allows you to call the function from itself without worrying about names.

edit: oops, just seen that's on a later slide.




Except in ES5 strict mode :-/


You can still do it, and without a Y combinator or anything like that too:

  var ninja = {
  	yell: function () {
  		var yellLocal = function(n) { 
  			return n > 0 ? yellLocal(n-1) + "a" : "hiy"; 
  		}
  		return yellLocal;
  	}()
  }




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: