Create a Set Class Challenge

I think this challenge must be bugged. Everything works properly for me to complete the class, but it will not pass.

Can you please share your code and describe what problems you are having? What do the failing tests say? What debugging steps have you tried?

I moved your post into a separate topic.

If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

The problem in the solution is in line 22:
this.dictionary[element] = 0;

just change it to:

The add method should look like this:
add(element) {
if (!this.has(element)) {
this.dictionary[element] = element;
return true;
} else {
return false;

Hope this helps
Also, sorry if I’m posting on the wrong place.

Thanks for letting us know. I fixed the solution!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.