JS中两个数组怎么比较是否相等!!
时间:2016-04-09 21:58:44
收藏:0
阅读:542
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循环逐个比较
.............................
原文:http://www.cnblogs.com/feile/p/5372739.html
评论(0)