No set function does this, but you can simply do an ad-hoc array intersection and check the length.
[8, 1, 10, 2, 3, 4, 5, 9].filter(function (elem) {
return arr1.indexOf(elem) > -1;
}).length == arr1.length
A more efficient way to do this would be to use .every
which will short circuit in falsy cases.
arr1.every(elem => arr2.indexOf(elem) > -1);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…