7 kyu
uniquePush - No Dupes!
1,276 of 1,278joeycozza
Loading description...
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
I am fine if you post your code here, as long as you mark it as a spoiler.
Without seeing your code, all I can say is that you need to make sure that none of the objects in the array already have that phoneNumber. Another way to think of it is that ALL of them don't have that number. Either way works, whichever one you can understand easier.
Oh wow I just solved it. Thanks for your help, sir!
This comment has been hidden.
This comment has been hidden.
Please provide Test object (or info that it's present) for user's own test cases
Okay, I added the Test info in comments like most other katas do. That is what you were asking me to do, right?
Thanks :-)
It's not stated in description what are unique items - items with unique phoneNumber or with both values unique. Also, dupeJoe is never pushed to array in tests.
Okay, I'll make it more explicit for what a duplicate object is.
I gave dupeJoe for your own usage and testing. Does it really matter if I use a different name in my test cases?
But I still can't see test cases that try to add elements with same phone number but different name.
Okay! Now I understand what you are saying. Sorry about that. I'll fix that right now.
-Edit. Okay, it should be fixed.
I'm quite sure that I fixed your concerns, could you mark the issue as resolved?