I would like a function that compares to arrays of javascript strings, and saving the values that didnt match in to a new array. At the moment im using a nested jquery foreach. But i think there are better ways than this?
$.each(imagesInUploadsFolder, function(i, outervalue){
$.each(imagesInDatabaseTable, function(i, innervalue){
if(outervalue == innervalue){
//match in both arrays...
}
});
});
Here’s a way using a JSON object and no jQuery, although the
$.inArray()should work fine:http://jsfiddle.net/7nJPW/1/
EDIT
Actually, the JSON method isn’t needed (?):
http://jsfiddle.net/7nJPW/2/