I'm trying to remove an array object from an array. First, I loop to the array of objects and if that array match to the given filter, then remove that object. Below is what I've tried but unfortunately not working, any help, ideas, clues, suggestions, recommendations please?
$(document).ready(function(){
var n_array = [{ 'name' : 'jason', 'age' : '24'},{ 'name' : 'jason2', 'age' : '20'}];
console.log(n_array);
for(var i = 0; i < n_array.length; i++){
if(n_array[i].name==='jason'){
n_array.splice(i,0);
}
}
console.log(n_array);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>