Created
February 25, 2020 18:20
-
-
Save munkacsitomi/52cbfe898b9dcecf4359b02549be54a5 to your computer and use it in GitHub Desktop.
Execution Context and Stack in JavaScript
This file contains hidden or 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
const text = 'Hello text!'; | |
console.log('Before defining functions'); | |
const useless = (callback) => { | |
console.log('In useless function'); | |
return callback(); | |
} | |
const getText = () => { | |
console.log('In getText function'); | |
return text; | |
} | |
console.log('Before making all the calls'); | |
console.log(useless(getText) === text, `The useless function works! ${text}`); | |
console.log('After the calls have been made'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment