Array.protype.splice();

Tell us what’s happening:
Describe your issue in detail here.

Your code so far


**const arr = [2, 4, 5, 1, 7, 5, 2, 1];**
**// if 1 is the Start Index**
**// 4 is the end index **
**arr.splice(1,4);**
**// it should return [4,5,1,7] But instead it return [2, 5, 2, 1]**

**// Only change code above this line**
**console.log(arr);**

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0

Challenge: Remove Items Using splice()

Link to the challenge:

no, the second argument in splice is the number of items to remove

OK Thanks understood.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.