Skip to content

Instantly share code, notes, and snippets.

@codingedgar
Last active January 4, 2021 21:30
Show Gist options
  • Save codingedgar/76f8772ade110b6c1d2c8d4a98f9876f to your computer and use it in GitHub Desktop.
Save codingedgar/76f8772ade110b6c1d2c8d4a98f9876f to your computer and use it in GitHub Desktop.
console.group('State of JS');
const randomCat = new Cat();
console.assert(randomCat.name === undefined);
if (!randomCat.name) {
randomCat.name = 'Pepo';
}
console.assert(randomCat.name === 'Pepo');
console.groupEnd();
/*
Console:
State of JS
get called undefined
get called undefined
set called Pepo
get called Pepo
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment