Skip to content

Instantly share code, notes, and snippets.

@andresvia
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andresvia/742255a9d387e43418f8 to your computer and use it in GitHub Desktop.
Save andresvia/742255a9d387e43418f8 to your computer and use it in GitHub Desktop.
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