Created
July 1, 2019 09:57
-
-
Save chickenfoot88/8bf1a2f45cd8a28bceb683734c80dfa8 to your computer and use it in GitHub Desktop.
sets a property on an object
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 myProperty = { | |
id: 1, | |
name: 'one' | |
} | |
const myObject = { ...myProperty && { propName: myProperty } }; | |
console.log('myObject', myObject) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment