Skip to content

solution#151

Open
Elena-brv wants to merge 2 commits into
mate-academy:masterfrom
Elena-brv:develop
Open

solution#151
Elena-brv wants to merge 2 commits into
mate-academy:masterfrom
Elena-brv:develop

Conversation

@Elena-brv

Copy link
Copy Markdown

No description provided.

Comment thread src/deepEqual.js Outdated
Comment on lines +23 to +27
if (a === null && b === null) {
return true;
} else if ((a === null && b !== null) || (a !== null && b === null)) {
return false;
}

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread src/deepEqual.js Outdated
Comment on lines +40 to +43
} 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]);

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants