Js Array delete element

+1 Diego Mariani · April 29, 2015
Hi there ! I am working in js to array of objects. I have to remove specific object in the array by index. how to do that ?

Post a Reply

Replies

Oldest  Newest  Rating
0 Bill Harding · May 28, 2015
you splice 1 at the index
var index= //the location in the array of the item you want to remove.

if (index > -1) {
   array.splice(index, 1);
}
  • 1

Javascript

107,283 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators