Created
March 12, 2018 13:47
-
-
Save kapusta/fee9692766776a25790d74fbd1c7ad5c to your computer and use it in GitHub Desktop.
compare two objects without recursion
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
(function() { | |
var obj1 = { | |
foo: 'qwerty', | |
bar: 'asdfgh', | |
}; | |
var obj2 = { | |
foo: '123456', | |
bar: '098765', | |
}; | |
var compare = function(a, b) { | |
return window.btoa(JSON.stringify(a)) === window.btoa(JSON.stringify(b)); | |
}; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bad idea, doesn't work with same props in diff order. Rectify unidea this.