Last active
July 30, 2020 10:26
-
-
Save nifrasismail/72cc4cde549f5cad9059751dda625430 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
//we are initiate an array | |
const hobbies = ["Sports", "Cooking"]; | |
//we are copy all the elements to the copyOfHobbies array | |
const copyOfHobbies = [...hobbies]; | |
/** | |
* we are copy all the elements of the copyOfHobbies array into | |
* copyOfHobbies2 array and adding one more hobby to there | |
*/ | |
const copyOfHobbies2 = [...hobbies, "Cricket"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment