A Pen by Dano Manion on CodePen.
Created
December 22, 2019 14:40
-
-
Save danomanion/2dc82c74329e7341967b257ed4d6e27b to your computer and use it in GitHub Desktop.
JavaScript: Map() copy Array.
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
myArray = ["hello","Jim",22] | |
myArrayCopy = [...myArray] | |
// console.log(myArrayCopy) | |
// || | |
myArrayCopyTwo = myArray.map((x) => x) | |
console.log(myArrayCopyTwo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment