Skip to content

Instantly share code, notes, and snippets.

@patricksimpson
Created August 26, 2015 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save patricksimpson/1b085010414162cfa2c1 to your computer and use it in GitHub Desktop.
Save patricksimpson/1b085010414162cfa2c1 to your computer and use it in GitHub Desktop.
const MY_KEY = Symbol();
let obj = {
[MY_KEY]: 123
};
"use strict";
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var MY_KEY = Symbol();
var obj = _defineProperty({}, MY_KEY, 123);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment