Published in: JavaScript
URL: http://jsfromhell.com/geral/equals
Tests if two or more objects are equal, accepts any type of object, even multidimensional arrays. Created: 2005.12.26
/************************************** * Jonas Raoni Soares Silva * http://www.joninhas.ath.cx **************************************/ equals = function(a, b){ for(var j, o = arguments, i = o.length, c = a instanceof Object; --i;) if(a === (b = o[i])) continue; else if(!c || !(b instanceof Object)) return false; else for(j in b) if(!equals(a[j], b[j])) return false; return true; };
You need to login to post a comment.
