Last Updated: June 08, 2023
·
28.21K
· emjayess

Console Stack-tracing Invoked Javascript Function Names

// Note: arguments.callee.name is a deprecated thing, so ymmv...

function __invoked(fn) {
    if (fn === '') {
        fn = 'anonymous'
    }

    console.trace(' >>> invoked: %s()]', fn)
}

function doWhatever() {
    __invoked(arguments.callee.name)

    // function code...
}
  NODES
Community 1
debugging 4
iOS 3
Javascript 15
Note 1
os 7