Return to Snippet

Revision: 33474
at October 9, 2010 01:38 by myke


Initial Code
function removeByElement(arrayName,arrayElement)
 {
    for(var i=0; i<arrayName.length;i++ )
     { 
        if(arrayName[i]==arrayElement)
            arrayName.splice(i,1); 
      } 
  }

Initial URL


Initial Description
Simply pass in array name and the value of the item you want to remove

Initial Title
Javascript remove item from array

Initial Tags
array

Initial Language
JavaScript