Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created October 21, 2017 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyanny/3c40743f072fea372462581c0f59c7b5 to your computer and use it in GitHub Desktop.
Save kyanny/3c40743f072fea372462581c0f59c7b5 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/yugatag
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
'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 a = 'hello';
var b = {
a: 'world'
};
console.log(b);
var c = _defineProperty({}, a, 'world');
console.log(c);
</script>
<script id="jsbin-source-javascript" type="text/javascript">let a = 'hello'
let b = {
a : 'world',
}
console.log(b)
let c = {
[a] : 'world',
}
console.log(c)</script></body>
</html>
'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 a = 'hello';
var b = {
a: 'world'
};
console.log(b);
var c = _defineProperty({}, a, 'world');
console.log(c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment