Last active
August 31, 2018 23:11
-
-
Save jimode/6d0fe12a61789e4a23a4b0d30b5ce7fb to your computer and use it in GitHub Desktop.
Shorthand for creating object literals - JS Bin// source https://jsbin.com/siqocem
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"; | |
var calories = 600; | |
var meal = { calories: calories }; | |
console.log(meal); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">const calories = 600; | |
const meal = { calories }; | |
console.log(meal);</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"; | |
var calories = 600; | |
var meal = { calories: calories }; | |
console.log(meal); // { calories: 600 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment