Tell us what’s happening:
I was testing this in code play and it seems it is giving me the right results but fcc does not allow it. I want to understand why this will not work in real code scenario.
This will insert a copy of the arr1 array into Arry, because you’re using the spread operator in a new array, not in the argument list itself. That results to
[4,[1,2,3],5,6]
instead of
[4,1,2,3,5,6]
It just so happens that they both have the same string representation:
Thanks. Truly appreciate it!
I have been playing around with for loops and all but ending up with […arr] when all I need to do is remove the brackets…
This is a life saver