[{name:'test', lastname: 'test', gender:'f'},{name:'test1', lastname: 'test1', gender:'f'},{name:'test2', lastname: 'test2', gender:'m'}]
{name:'test1', lastname: 'test1', gender:'m'}
var data = [{name:'test', lastname: 'test', gender:'f'},{name:'test1', lastname: 'test1', gender:'f'},{name:'test2', lastname: 'test2', gender:'m'}],
massiv = {name:'test1', lastname: 'test1', gender:'m'};
data.forEach(function(d, index){
if (d == massiv) {
data.splice(index, 1)
}
});
var someArray = [{name:'test', lastname: 'test', gender:'f'},{name:'test1', lastname: 'test1', gender:'f'},{name:'test2', lastname: 'test2', gender:'m'}];
$.each(someArray, function(i){
if(someArray[i].gender === 'm') {
someArray.splice(i,1);
return false;
}
});
console.log(someArray);
someArray = [{name:'test', lastname: 'test', gender:'f'},{name:'test1', lastname: 'test1', gender:'f'},{name:'test2', lastname: 'test2', gender:'m'}];
johnRemoved = someArray
.filter(function (el) {
return el.gender !== "m";
}
);
console.log(johnRemoved);