+ 1

In the code I've used array splice method, why it only removes one item ? As I've used -1 as index and 3 as remove count. Help!

https://code.sololearn.com/W0BAg5c8JGo7/?ref=app

22nd Jan 2020, 12:32 PM
Argon
2 Respuestas
+ 1
-1 is last, 3 items from last is only last, if you want to remove last three, should be splice(-3,3)
23rd Jan 2020, 5:59 AM
Gordon
Gordon - avatar
0
Oh, Thanks!😊 My bad !
23rd Jan 2020, 6:06 AM
Argon