-
Notifications
You must be signed in to change notification settings - Fork 197
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
countSetBits implemented #204
Conversation
lib/unique.js
Outdated
@@ -0,0 +1,8 @@ | |||
//Return the number of unique elements in the array |
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.
what should we do about complex items in arrays? like objects or other arrays? maybe just use strict equality checking (===
)? A test for this situation would be very explanatory. Something like
const omg = {omg:1};
expect(unique([omg, {omg:1}, omg])).toBe(2); // or 1 if you have something else in mind.
would help whoever implements this in the future.
lib/unique.js
Outdated
@@ -0,0 +1,8 @@ | |||
//Return the number of unique elements in the array | |||
|
|||
function unique(arr) { |
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.
Maybe call it uniqueCount
?
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.
Just a quick clarity update requested.
@dna113p looks like there are some conflicts. Can you clean those up? I'm looking forward to getting this in for you. |
@dna113p Thanks for taking the feedback and updating your branch! I'll merge it in. If you could create the issue for your skeleton method that would be very helpful for us. |
yarn lint
does not trigger any linter errorsCloses #201