fruits = ["mango","apple","pine","berry"];
If I want to remove an element index wise, How to do that using JavaScript. Also you can use library as required.
fruits = ["mango","apple","pine","berry"];
If I want to remove an element index wise, How to do that using JavaScript. Also you can use library as required.
You can use splice
to do the same. Syntax = array.splice(start_index, no_of_elements)
Following is the command:
fruits.splice(2, 1)
This will remove one element from index 2, i.e. after the operation fruits=["mango","apple","berry"];