I would like to have a function in javascript (jQuery if possible) that will allow me to pass an array of ids into a function, and check if each value is found in another array to return TRUE.
e.g
var ids1 = [1, 6, 9, 11, 20];
var ids2 = [5, 6, 9, 11];
function check_array(ids)
{
var search = [1, 6, 9, 11, 20];
// do some checking here
// if all ids are matched up return TRUE;
// otherwise return FALSE;
}
In this instance - the first var ids1 would return TRUE, while the second var ids2 would return FALSE.
Can anyone suggest the simplest/cleanest method for this?