I want to give the anonymous function's name that is inside my function based on the parameters passed. For example, if the passed parameter is "nature" then I want to create an anonymous function with that name.
Example code:
function hello(nature) {
window.nature /* I want this word "nature" to be taken from the parameter passed by the function */ = function () {
console.log('succes');
}
}