One day I needed to get the function name from the function itself. Here is what I found.
function functionName(fn)
{
var name=/\W*function\s+([\w\$]+)\(/.exec(fn);
if(!name)return 'No name';
return name[1];
}
via http://bytes.com/topic/javascript/answers/640929-obtain-function-name
Latest posts by Fab (see all)
- Frankenstein: review (and the truth) - 15 November 2025
- Voyage au bout de la nuit: review - 15 October 2025
- 2025 New Years Eve Party - 29 September 2025
