Skip to content

Instantly share code, notes, and snippets.

@hyongbai
Created September 21, 2019 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyongbai/effca40bec7506586e2e968527258867 to your computer and use it in GitHub Desktop.
Save hyongbai/effca40bec7506586e2e968527258867 to your computer and use it in GitHub Desktop.
function trace(count) {
var i = 0;
var caller = arguments.callee.caller;
count = count || 10;
while ((caller = caller.caller) && i++ < count) {
console.log(i+":"+caller.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment