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

Set's implementation is not rigorous. #148

Closed
reactjser opened this issue Sep 20, 2019 · 2 comments
Closed

Set's implementation is not rigorous. #148

reactjser opened this issue Sep 20, 2019 · 2 comments

Comments

@reactjser
Copy link

class Set {
   ...
}

const s = new Set()
s.add(1)
s.add('1')
console.log(s.size()); // 1
console.log(s.values()); // 1

The 1 is not same as '1'.

@Jeffzholy
Copy link

Hi @reactjser yes you are right, but from my perspective the build-from-scratch data structure is for mimicking native Set behaviours and understanding the concept of Set, not for any production use; for sure it can be improved, but not a must, thanks

@reactjser
Copy link
Author

Thanks for your reply.

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

No branches or pull requests

2 participants