-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solution #151
base: master
Are you sure you want to change the base?
solution #151
Conversation
src/deepEqual.js
Outdated
if (a === null && b === null) { | ||
return true; | ||
} else if ((a === null && b !== null) || (a !== null && b === null)) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null === null is true, so you don't need to write such amount of code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/deepEqual.js
Outdated
} else if (typeof (a[key]) !== 'object' && a[key] !== b[key]) { | ||
return false; | ||
} else if (typeof (a[key]) === 'object') { | ||
const result = deepEqual(a[key], b[key]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can run your function deepEqual earlier and it will check primitives too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
No description provided.