let a = [1, 2, 3, 4, 5, 6, 7, 8];let b = [1, 2];let c = [3, 9];function includes(arr1, arr2) {return arr2.every(val => arr1.includes(val));}console.log(includes(a, b)); //trueconsole.log(includes(a, c)); //false
转自:/weixin_42971942/article/details/86692071