I have an array:
arr = [50, 40, 50, 50];
I need to delete first element, that equal 50 and dont touch another.
This code return only [40].
arr = arr.filter(function(e) {return e !== 50}) // [40]
But I need
arr = arr.somefunction(function(e) {return e !== 50}) // [40, 50, 50]
I would be grateful for any help.
arr.splice(0, 1);It changes the array itself and returns removed element(s) as new array.