Python-Linux-Javascript

How to remove an element from a javascript array

☕️ 1 min read

How to remove an element from Javascript Array

Let’s say you have an array like the following:

var arr = ['first','second','third','fourth']

To remove the element “second” do the following:

arr.splice(1,1)

Notice the following: The array is modified in place.