How can JS judge that multiple arrays have the same value at the same time?

Array 1 [3, 5, 56, 38, 33]

use array 1 to determine whether the values of the following arrays are the same

Array 2 [6 Peregrine 48 remiere 5 br 36,]
Array 3 [16 Personality 43 pencils 15 36 pencils 33]
Array 4 [1 pence 23 pence 56 pencils 3 pence 7]
Array 5 [86 pence 3 pens 15 pens 15 22 pines 33]

Apr.19,2022


:for/forearch

var arr_a=[];
var arr_b=[];
var arr_c=[];
for(var i =0;i<.length;iPP){
    cnosole.log( arr_b.indexOf(arr_a[i]) );
    cnosole.log( arr_c.indexOf(arr_a[i]) );
}

the second: write all the arrays to be judged into objects and double traverse the judgment;

var arr_a=[];
var obj_b={
    "arr_b":[],
    "arr_c":[]
}
for(var x in obj_b){
    for(var i=0;i<obj_b[x].length;iPP){
        console.log(obj_b[x].indexOf(arr_a[i]) );
    }
}

Menu