Skip to content

Instantly share code, notes, and snippets.

@kranfix
Created March 29, 2020 18:59
Show Gist options
  • Save kranfix/4b1774e940cc112098e7e559fb5a8323 to your computer and use it in GitHub Desktop.
Save kranfix/4b1774e940cc112098e7e559fb5a8323 to your computer and use it in GitHub Desktop.
class Foo {
constructor(){
this.bar = "Hello!";
}
}
let foo = new Foo()
console.log(`${foo.bar} == ${foo["bar"]}`)
console.log("----------------------------")
foo.bar = "Good bye"
console.log(`${foo.bar} == ${foo["bar"]}`)
console.log("----------------------------")
foo["bar"] = "See you!"
console.log(`${foo.bar} == ${foo["bar"]}`)
console.log("----------------------------")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment