Named functions in Javascript

I am at Progessive.Net at the moment in the Helen Emerson talk. She mentioned a benefit of naming functions, you can then use them to recurse. Normally I would assign a function like
var boo = function() { //something };
But if you name the function as well, you can then use it to recurse. I didn't realise you could do this so I am quite pleased. She also mentioned that it can also help when debugging and when you are catching exceptions.

Anyway, here's an example!

Update: Her examples and presentation is available on her github account I really like the console library that she is using. Quite a cool little thing.


Popular posts from this blog

Follow on from home automation post

Functional Filtering in Javascript

Derbyshire Dot Net Talk - Writing Robust Systems