Created
June 25, 2020 08:00
-
-
Save rakibhasansabbir/2c838b3bf0ecc48a707aff991dc349bc to your computer and use it in GitHub Desktop.
Adding array to another array example for javascript
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
const array1 = [1, 2, 3, 4, 5] | |
const array2 = [6, 7, 8, 9, 10] | |
// to add after | |
const newArray = [...array1, ...array2] | |
// to add before | |
const newArray = [...array2, ...array1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment