Last active
November 7, 2016 02:46
-
-
Save jonajgs/4d9bec3f5dd9307de25258b07a220df2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
equals: (obj1, obj2) => { | |
let obj1Props = Object.getOwnPropertyNames(obj1); | |
let obj2Props = Object.getOwnPropertyNames(obj2); | |
if (obj1Props.length != obj2Props.length) { | |
return false; | |
} | |
obj1Props.map(op => { | |
if ( obj1[op] !== obj2[op] ) { | |
return false; | |
} | |
}); | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment