How is it possible to learn the name of function I am in?
The below code alerts \'Object\'. But I need to know how to alert \"Outer.\"
function Oute
As of ES6, you can use Function.prototype.name. This has the added benefit of working with arrow functions, since they do not have their own arguments object.
function logFuncName() { console.log(logFuncName.name); } const logFuncName2 = () => { console.log(logFuncName2.name); };