+ 1
Concat vs push
Are these 2 doing the same thing or you use them differently based on certain situations? https://code.sololearn.com/WYVDHl2G453l/?ref=app
1 ответ
+ 4
The push() adds elements to the end of an array and returns the new length of the array. ... The concat() method is used to merge arrays.Concat does not change the existing arrays, but instead returns a new array.
So we it according to conditions