Created
May 30, 2021 09:46
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 addOne() { | |
// this time, we define counter within our function | |
let counter = 0; | |
counter++; | |
} | |
// what do we expect to happen here? | |
console.log(counter); // <Fill in Expected Result> | |
// should this work? why/why not? | |
counter++; | |
console.log(counter); // <Fill in Expected Result> | |
addOne(); | |
console.log(counter); // <Fill in Expected Result> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment