Created
January 26, 2022 20:17
-
-
Save midorikocak/a8629a84cc1b33b83558eaa05925e741 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
let innocentVariable = "princess"; | |
function innocentFunction(param) { | |
console.log(`innocent function is running`); | |
console.log(`who is ${param}`); | |
console.log( | |
"innocent function removed from the callback and not calling another function" | |
); | |
} | |
function badFunction() { | |
console.log("bad function is running"); | |
let badVariable = `crazy ${innocentVariable}`; | |
console.log("innocent function is called"); | |
innocentFunction(badVariable); | |
console.log("bad function is removed from the callstack"); | |
} | |
function goodFunction(param) { | |
console.log("good function is running"); | |
let goodVariable = `smart ${param}`; | |
console.log("good func is removed from the callback"); | |
return goodVariable; | |
} | |
console.log("bad function is called"); | |
badFunction(); | |
innocentFunction(goodFunction(innocentVariable)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment