var a = [ 1, 2 ], b = [ 1, 2 ], c = [ 1, 3 ]; alert(a == b);//false alert(a == c);//false,切记不能直接比较!! //法一: alert(a.toString() == b.toString());//true alert(a.toString() == c.toString());//false //法二:运用for循环逐个比较 .............................
时间: 2024-10-21 16:37:28