Created
February 19, 2018 22:15
-
-
Save Joejhorn/1cc97a419e17ab86d56be3469dc2c0ac to your computer and use it in GitHub Desktop.
Spread Operator Example - copy an array
This file contains hidden or 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
| const arr1 = ['JAN', 'FEB', 'MAR', 'APR', 'MAY']; | |
| let arr2; | |
| (function() { | |
| "use strict"; | |
| arr2 =[...arr1] ; // here you go. | |
| console.log(arr2); | |
| })(); | |
| console.log(arr2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment