Fix error
const combined = [...arr1, arr2] would result in [ 1, 2, 3, [ 4, 5, 6 ] ]
This commit is contained in:
committed by
GitHub
parent
4cf3b6f14c
commit
bef132dadd
@ -27,7 +27,7 @@ Using the spread operator, it’s possible to combine two or more arrays into on
|
||||
```js
|
||||
const arr1 = [1, 2, 3];
|
||||
const arr2 = [4, 5, 6];
|
||||
const combined = [...arr1, arr2];
|
||||
const combined = [...arr1, ...arr2];
|
||||
// [1, 2, 3, 4, 5, 6]
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user