Created
October 21, 2017 15:36
-
-
Save kyanny/3c40743f072fea372462581c0f59c7b5 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/yugatag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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