Let’s say I’m given a string, and I want to define a function with a name of that string. How can I do this?
UPDATE:
I forgot to mention that I do not want to set an anonymous function to a property because I would also like to dynamically grab the function’s name from inside the function ie. arguments.callee.name
Like this:
Depending on the requirements, maybe something like this would work: