Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created March 1, 2023 18:26
Show Gist options
  • Save isaacs/ce1b61682cbb08174ba886e46db49ded to your computer and use it in GitHub Desktop.
Save isaacs/ce1b61682cbb08174ba886e46db49ded to your computer and use it in GitHub Desktop.
// look at this glorious shit!! look what you can do with with!!
const someObject = {
foo: 'bar',
baz: 1,
asdf: ['quux'],
}
with (someObject) {
console.log(foo)
console.log(baz)
console.log(asdf)
asdf.push(baz)
}
console.log(someObject.asdf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment