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
You can use map function also.
someArray = [{name:"Kristian", lines:"2,5,10"},{name:"John",lines:"1,19,26,96"}]; newArray=[]; someArray.map(function(obj, index){ if(obj.name !== "Kristian"){ newArray.push(obj); } }); someArray = newArray; console.log(someArray);