Skip to content

Instantly share code, notes, and snippets.

@bgoonz
Created May 30, 2021 09:46
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