SOURCE

function IncludesArr(arr1,arr2){
    let a = new Set(arr1)
    let b=new Set(arr2)

    // 重复元素完全包含
    let newArr =[...arr1].filter(item => b.has(item))

    return  newArr.length == arr1.length || newArr.length == arr2.length
}
let a=[1,2,2,5]
let b=[2,2]
console.log(IncludesArr(b,a))
console 命令行工具 X clear

                    
>
console