Remove object from a JavaScript Array? [duplicate]

You could do a filter.

var arr = [
  {url: "link 1"},
  {url: "link 2"},
  {url: "link 3"}
];

arr = arr.filter(function(el){
  return el.url !== "link 2";
});

PS: Array.filter method is mplemented in JavaScript 1.6, supported by most modern browsers, If for supporting the old browser, you could write your own one.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)