js remove element from array 1

js remove element from array

//Remove specific value by index
array.splice(index, 1);

Here is what the above code is Doing:
1. We create an array with the values 1, 2, 3, 4, and 5.
2. We remove the value at index 2, which is 3.
3. We remove the value at index 0, which is 1.
4. We remove the value at index 4, which is 5.

Similar Posts