Last active
February 8, 2016 21:42
-
-
Save TravisMullen/3a20f75650c9eceb2851 to your computer and use it in GitHub Desktop.
Matching Object Hash
This file contains 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
var alpha = { | |
'a': { | |
'random data': {} | |
}, | |
'b': { | |
'more random data': {} | |
} | |
}, // object hash | |
beta = { | |
'a': true, | |
'b': false | |
}; // hash to be compared | |
if ( Object.keys( alpha ).sort().toString().indexOf( Object.keys( beta ).sort().toString() ) === -1 ) { | |
// true because the keys in each object match | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment