Skip to content

Instantly share code, notes, and snippets.

View Nithanaroy's full-sized avatar
🎯
Focusing

Nitin Pasumarthy Nithanaroy

🎯
Focusing
View GitHub Profile
@Nithanaroy
Nithanaroy / deepEqual.js
Created February 22, 2017 00:56
Deeply compare two JavaScript objects
function deepEqual ( a, b ) {
let equalCount = Object.keys( a ).length === Object.keys( b ).length;
if ( equalCount ){
for ( let key in a ){
if ( typeof a[key] === typeof b[key] ){
if ( typeof a[key] !== "object" ){
if ( a[key] !== b[key] ){
return false;
}
} else {