mirror of
https://github.com/Fechin/reference.git
synced 2026-11-21 05:24:10 +03:00
Merge pull request #151 from Keivan-sf/patch-1
Fix: remove `[]` of the array in concat method
This commit is contained in:
1 file changed
+1
-1
+1
-1
@@ -574,7 +574,7 @@ const newFirstElement = 4
|
||||
[newFirstElement].concat(array)
|
||||
|
||||
// => [ 3, 2, 1, 4 ]
|
||||
[array].concat(newFirstElement)
|
||||
array.concat(newFirstElement)
|
||||
```
|
||||
if you want to avoid mutating your original array, you can use concat.
|
||||
|
||||
|
||||
Reference in new issue
Block a user