Skip to content
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

Can Object === Object be actual deep equality? #36179

Closed
greysonevins opened this issue Nov 19, 2020 · 2 comments
Closed

Can Object === Object be actual deep equality? #36179

greysonevins opened this issue Nov 19, 2020 · 2 comments
Labels
question Issues that look for answers.

Comments

@greysonevins
Copy link

I must be the first person to care enough about this but, can we change someObject === anotherObject to check the object keys and values instead of checking the memory allocation of it.

@benjamingr
Copy link
Member

benjamingr commented Nov 19, 2020

Hey, thanks for opening an issue :]

can we change someObject === anotherObject to check the object keys and values instead of checking the memory allocation of it.

No, and that is defined by the JavaScript language and ECMAScript specification and not by Node.js

This is 100% impossible for Node.js to do without breaking the whole ecosystem.

If you feel strongly about this I recommend you spend time contributing to proposals to improve JavaScript itself with this sort of capability like the record/tuple proposal which aims to add this capability to the language.

Edit: here is how to contribute to a TC39 proposal

@targos
Copy link
Member

targos commented Nov 19, 2020

Note that in Node.js you can use require('util').isDeepStrictEqual(someObject, anotherObject) for that.

@ChALkeR ChALkeR added the question Issues that look for answers. label Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

4 participants