判断数组相同:

let a = ['张三','18','唱歌'],
    b = ['唱歌','张三','18'];
if(JSON.stringify(a.sort()) === JSON.stringify(b.sort())){
    console.log('相等');
}

效果如下:

效果图

以上文章来自:黄卉 , https://huanghui8030.github.io/js/equality.html