How check if two array contains same elements in JavaScript? Source: https://stackoverflow.com/a/49218423/3599272
const A = [0, 1, 2],
B = [2, 1, 0],
C=[2, 1];
// A.every( e => B.includes(e) )
console.log(A.every(e => B.includes(e)));
console.log(A.every(e => C.includes(e)));
console.log(C.every(e => B.includes(e)));