Advertisement
Guest User

Untitled

a guest
Mar 20th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. function isObjectEqual(a, b) {
  2. let aProps = Object.getOwnPropertyNames(a),
  3. bProps = Object.getOwnPropertyNames(b);
  4.  
  5. if (aProps.length !== bProps.length) {
  6. return false;
  7. }
  8.  
  9. for (let i = 0; i < aProps.length; i++) {
  10. let propName = aProps[i];
  11. if(a[propName] !== b[propName]) {
  12. return false;
  13. }
  14. }
  15.  
  16. return true;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement