How to remove/delete a row in javascript array by having value of first item of array row? -


i create array this:

var myarray = new array(); myarray.push({ url: urlvalue, filename: filenamevalue }); 

urlvalue , filenamevalue javascript variables. after while array lots of items , if want delete row having urlvalue how can delete row?(by row mean delete urlvalue , filenamevalue).for example want delete row has urlvalue= http://www.somsite.com/pics/picture12.jpg , filenamevalue=picseasonnewname.jpg

you can remove entire object array using

function removerow(value){      for(var i=0; i<myarray.length; i++){         if(myarray[i].urlvalue == value)            myarray.splice(i,1);     } } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -