var clickHandler = function() {
// ...
};
var keykHandler = function keykHandler() {
// ...
};
The first function is called anonymous function expression
The second function is called named function expression
You should always use named function expression and there are three reasons for that:
- Handy function self-reference (e.g. recursion)
- More debuggable stack traces
- More self-documenting code