Created
August 3, 2016 04:27
-
-
Save anonymous/661c30da6ac53b871a888241f2249184 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/libega
This file contains hidden or 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 firstName = "John"; | |
| var lastName = "Doe"; | |
| var start = "go"; | |
| function greet() { | |
| console.log("Hi"); | |
| } | |
| var person = _defineProperty({ | |
| firstName: firstName, | |
| lastName: lastName, | |
| greet: greet | |
| }, start, function () { | |
| console.log("start"); | |
| }); | |
| console.log(person); | |
| person.greet(); | |
| person.go(); | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">let firstName = "John"; | |
| let lastName = "Doe"; | |
| let start = "go" | |
| function greet() { | |
| console.log("Hi"); | |
| } | |
| let person = { | |
| firstName, | |
| lastName, | |
| greet, | |
| [start]() { | |
| console.log("start"); | |
| } | |
| } | |
| console.log(person); | |
| person.greet(); | |
| person.go();</script></body> | |
| </html> |
This file contains hidden or 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 firstName = "John"; | |
| var lastName = "Doe"; | |
| var start = "go"; | |
| function greet() { | |
| console.log("Hi"); | |
| } | |
| var person = _defineProperty({ | |
| firstName: firstName, | |
| lastName: lastName, | |
| greet: greet | |
| }, start, function () { | |
| console.log("start"); | |
| }); | |
| console.log(person); | |
| person.greet(); | |
| person.go(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment