Fix: remove [] of the array in concat method

This fixes the difference between commented results and the actual code
This commit is contained in:
Keivan authored and GitHub committed 2022-02-01 23:42:47 -05:00
1 parent e6a350a39a
commit d9baaea4c2
1 file changed
+1 -1
+1 -1
View File
@@ -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.