mirror of
https://github.com/Fechin/reference.git
synced 2026-11-21 05:24:10 +03:00
Fix: remove [] of the array in concat method
This fixes the difference between commented results and the actual code
This commit is contained in:
1 parent
e6a350a39a
commit
d9baaea4c2
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