Created
October 15, 2020 20:36
-
-
Save KyleMit/a9c8291f9097fb09d2d16248e26f5e8a to your computer and use it in GitHub Desktop.
Twitter - Object Initializer Shorthand
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
let cat = {name: "Frida", age: 10 } | |
let dog = {name: "Ranger", age: 7 } | |
// before | |
console.log("cat", cat) | |
console.log("dog", dog) | |
// after | |
console.log({cat, dog}) | |
// { | |
// cat: {name: "Frida", age: 10 } | |
// dog: {name: "Ranger", age: 7 } | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment