I have this array:
var array = [{"a":"1","b":"2"},{"a":"3","b":"1"},{"a":"5","b":"4"}]
now i want to remove the line, lets say, where a=5. So afterwards the array looks like this:
var array = [{"a":"1","b":"2"},{"a":"3","b":"1"}]
How do i do this the easiest and fastest way?
You can use
jQuery.mapwhich allows you to return null for an element to be deleted.eg:
Live example (watch the console): http://jsfiddle.net/2Yz7f/