Created
July 30, 2020 10:30
-
-
Save nifrasismail/ce4c909c00a3c7fb9ef5c88053ca910e to your computer and use it in GitHub Desktop.
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
//intiate an object of a person | |
const person = { | |
name: "Mark", | |
age: 28, | |
greet() { | |
console.log("Hello, World"); | |
}, | |
}; | |
//copy all the person attribute to another copyOfPerson obje | |
const copyOfPerson = { ...person }; | |
/** | |
* copy the person object into newly created copyOfPersonWit | |
* object and add another field called job | |
*/ | |
const copyOfPersonWithJob = { ...person, job: "Developer" }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment