Possible Duplicate:
Remove specific element from a javascript array?
Specifically I have an array as follows:
var arr = [ {url: 'link 1'}, {url: 'link 2'}, {url: 'link 3'} ];
Now you want to remove valuable element url "link 2" and after removing the only arrays as follows:
arr = [ {url: 'link 1'}, {url: 'link 3'} ];
So who can help me this problem? Thanks a lot
indexOf
will not work here. So, unless the index is (always) known, a bit of the puzzle is missing withsplice
...arr.filter(function(element){ return(element.url === 'link 2'? false :true); })