I'm trying to create a generic function ('displayFuncName()' for example) that I could call in different function definitions (for example 'foo()'), so it will console.log the function name ('foo' in this example). something like:
var displayFuncName = function(){
console.log("caller function name: " + some parameter);
}
var foo = function(){
displayFuncName(); // should console log "caller function name: foo
}
I know it was asked in different ways in the past, but it seems like there was some deprecated option, and some of them just shows the 'displayFuncName' function name, which is of course not what I want.