Skip to content

Instantly share code, notes, and snippets.

@dabbott
Created December 15, 2016 22:18
Show Gist options
  • Save dabbott/24aeb2851e31911bf898b54fbd2365c7 to your computer and use it in GitHub Desktop.
Save dabbott/24aeb2851e31911bf898b54fbd2365c7 to your computer and use it in GitHub Desktop.
compareProps = (a, b) => {
for (let key in a) {
if (a[key] !== b[key]) console.log('Changed:', key, a[key], '=>', b[key]);
}
for (let key in b) {
if (!(key in a)) console.log('Added:', key, b[key]);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment