Answers for "check fpr multiple values in an array jquery"

0

check fpr multiple values in an array jquery

function containsAll(needles, haystack){ 
  for(var i = 0; i < needles.length; i++){
     if($.inArray(needles[i], haystack) == -1) return false;
  }
  return true;
}

containsAll([34, 78, 89], [78, 67, 34, 99, 56, 89]); // true
containsAll([34, 78, 89], [78, 67, 99, 56, 89]); // false
containsAll([34, 78, 89], [78, 89]); // false
Posted by: Guest on March-15-2021

Code answers related to "check fpr multiple values in an array jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language