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...
}
Written by matt j. sorenson
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#