Skip to content

Instantly share code, notes, and snippets.

@dherman
Last active October 14, 2016 05:31
Show Gist options
  • Save dherman/5833046e9da8b29baa78c16d137c4a04 to your computer and use it in GitHub Desktop.
Save dherman/5833046e9da8b29baa78c16d137c4a04 to your computer and use it in GitHub Desktop.
this.foo = "foo";
this.let = {
get foo() { console.log("getter!") },
set foo(x) { console.log("setter!") }
};
{
// let[foo]; // syntax error
(let)[foo]; // "getter!"
let[foo] = [17]; // binds foo to 17
(let)[foo] = [17]; // "setter!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment