dakociha,
<script>
function deepEqual(a, b) {
if (a === b) {
return true;
}
if (a == null || typeof(a) !== 'object' || b == null && typeof(b) !== 'object') {
return false;
}
var equal = true;
for (var key in a) {
if (typeof(a) === 'object' && typeof(b) === 'object') {
if (!deepEqual(a[key], b[key])) {
equal = false;
}
} else if (a !== b) {
equal = false;
}
}
return equal;
}
var obj = {
here: {
is: "an"
},
object: 2
};
alert(deepEqual(obj, {
here: {
is: "an"
},
object: 2,
test : 5
}));
</script>