Last active
August 29, 2015 14:07
-
-
Save andresvia/742255a9d387e43418f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var deepEqual = function(o1, o2) { | |
if (typeof(o1) == "object" && | |
typeof(o2) == "object" && | |
o1 != null && | |
o2 != null) { | |
for(var p1 in o1) { | |
if (!deepEqual(o1[p1], o2[p1])) return false | |
} | |
for(var p2 in o2) { | |
if (!deepEqual(o1[p2], o2[p2])) return false | |
} | |
return true | |
} | |
if (o1 === o2) return true | |
else return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment