How can I remove an object from an array? I wish to remove the object that includes name Kristian from someArray. For example:
Kristian
someArray
som
This is a function that works for me:
function removeFromArray(array, value) { var idx = array.indexOf(value); if (idx !== -1) { array.splice(idx, 1); } return array; }