+ 2
Pls what is wrong?
This is to remove all occurences of 1 https://code.sololearn.com/WV03Cu2CQ8Iw/?ref=app
3 Antworten
+ 2
In your code, in the first iteration, the splice method performs operation of removing 1 from the array and returning the spliced element so the function ended. So the function return is only one 1
Here is what splice do:
https://code.sololearn.com/W3cNMx37R657/?ref=app
Here is a solution for you:
https://code.sololearn.com/WOpSE8iFo1e3/?ref=app
+ 1
Yes my solution for you is removing only the 1's
0
The code removed some other numbers from the array. I'd like to remove only the 1's