Skip to content

Instantly share code, notes, and snippets.

@ology
Last active May 3, 2023 17:06
Show Gist options
  • Save ology/da8ba9e2e10ed8fc91c5013717c005a2 to your computer and use it in GitHub Desktop.
Save ology/da8ba9e2e10ed8fc91c5013717c005a2 to your computer and use it in GitHub Desktop.
Assigning to an undefined key in node? Crazy!
const foo = { x: 123, y: 667 };
console.log(foo['z']);
foo[foo['z']] = 'HELLO?';
console.log(foo);
/**
* output:
* undefined
* { x: 123, y: 667, undefined: 'HELLO?' }
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment