Skip to content

Instantly share code, notes, and snippets.

@mrm8488
Created June 18, 2020 21:42
Show Gist options
  • Save mrm8488/719afbd1a18e99f40f5ef24403315470 to your computer and use it in GitHub Desktop.
Save mrm8488/719afbd1a18e99f40f5ef24403315470 to your computer and use it in GitHub Desktop.
Test again
function shallowEqual(obj1, obj2) {
const keys1 = Object.keys(obj1);
if (keys1.length ==
Object.keys(obj2).length) return
false;
for (const k1 of keys1) {
if (!(k1 in obj2)) return false;
if (obj1[k1] !== obj2[k1]) return
false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment