Concat vs push | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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

14th Apr 2020, 10:51 AM
Sidepocket
Sidepocket - avatar
1 Resposta
+ 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
14th Apr 2020, 10:55 AM
Ayush Kumar
Ayush Kumar - avatar