Created
March 24, 2019 02:01
-
-
Save EmmanuelBeziat/ca7167227e8c111a11dc6acc3f52eede to your computer and use it in GitHub Desktop.
Return differences between javascript objects's parameters' values
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 compare (object1, object2) { | |
let result = [] | |
Object.keys(object1).forEach(key => { | |
if (object1[key] !== object2[key]) { | |
result.push(object2[key]) | |
} | |
}) | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment