Get Function Name


/ Published in: JavaScript
Save to your folder(s)

Get Function Name
============

This will only return (a string) if the object passed to getFunctionName is a function or an "object" function from IE.
The function does not rely on function.name if present as it can't always be trusted.

Examples:

getFunctionName(function Foo(){}) == "Foo"
getFunctionName(function(){}) == ""

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.