-
-
Save bernar83/5cc762b79099e95cc295d32e6adbb8d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo() { | |
// call-stack here is `foo` | |
// call-site is in the global scope | |
console.log( 'first' ); | |
baz(); // call-site here is for `baz` | |
} | |
function baz() { | |
// call-stack here is `foo` -> `baz` | |
console.log( 'second' ); | |
bar(); // call-site here is for `bar` | |
} | |
function bar() { | |
// call-stack so far is `foo` -> `baz` -> `bar` | |
// the call-site for this function is in 'baz' | |
console.log( 'third' ); | |
} | |
foo(); // call-site for `foo` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment