Merge pull request #151 from Keivan-sf/patch-1

Fix: remove `[]` of the array in concat method
This commit is contained in:
Randy8080 authored and GitHub committed 2022-02-07 13:59:14 +08:00
commit fde9878d82
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.