var a = [1,2,3]; var b = [1,2,3]; var c = [[1,2,3]]; alert(JSON.stringify(a) == JSON.stringify(b)); alert(JSON.stringify(a) == JSON.stringify(c));