Added work from my other class repositories before deletion

This commit is contained in:
2017-11-29 10:28:24 -08:00
parent cb0b5f4d25
commit 5ea24c81b5
198 changed files with 739603 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
function deepEqual(a, b){
if(((typeof(a) === 'object') && (a !== null)) &&
((typeof(b) === 'object') && (b !== null))){
var size_a = 0;
var size_b = 0;
for(prop in a){ size_a++; }
for(prop in b){ size_b++; }
if(size_a == size_b){
for(prop in a){
if(!b.hasOwnProperty(prop)){
return false;
}
}
for(prop in a){
if(!deepEqual(a[prop], b[prop])){
return false;
}
}
}else{
return false;
}
}else{
return (a === b);
}
return true;
}
var obj = {here: {is: "an"}, object: 2};
console.log(deepEqual(obj, obj));
console.log(deepEqual(obj, {here: 1, asd: 2}));
console.log(deepEqual(obj, {here: {is: "an"}, object: 2}));
//console.log(deepEqual(1, 2));
//console.log(deepEqual(2, 2));