📜  js 比较数组 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:25.083000             🧑  作者: Mango

代码示例6
const arr1 = [1, 2, 3];
const arr2 = [1, 3, 3];

if (arr1.length !== arr2.length) return console.log("false");
for (let i = 0; i < arr1.length; i++) {
    for (let j = 0; j < arr2.length; j++) {
        if (arr1[i] === arr2[j]) {
            console.log("yes match", arr1[i], arr2[j]);
            continue;
        }
        console.log("no match", arr1[i], arr2[j]);
    }
}