var a = [1, 2, 5, 7, 3];
var b = [1, 7];
var isContained=function (aa, bb) {
if(!(aa instanceof Array) || !(bb instanceof Array) || ((aa.length < bb.length))) {
return false;
}
for (var i = 0; i < bb.length; i++) {
var flag = false;
for(var j = 0; j < aa.length; j++){
if(aa[j] == bb[i]){
flag = true;
break;
}
}
if(flag == false){
return flag;
}
}
return true;
}
isContained(a,b) 返回值 true