1function containsAll(needles, haystack){
2 for(var i = 0; i < needles.length; i++){
3 if($.inArray(needles[i], haystack) == -1) return false;
4 }
5 return true;
6}
7
8containsAll([34, 78, 89], [78, 67, 34, 99, 56, 89]); // true
9containsAll([34, 78, 89], [78, 67, 99, 56, 89]); // false
10containsAll([34, 78, 89], [78, 89]); // false
11