Please help on challenge "create a hash table"

You’re right, by deleting that line the challenge passes. Thank you.

But it seems to me that my solution is the correct one, and maybe the system tests need to be recalibrated.

With the current solution, the remove method does not delete a single key-value pair, but all the key-value pairs associated with a certain hash. And for each hash there can be many key-value pairs, as many as there are collisions.

One way to handle collisions is to just store both
key-value pairs at that index. Then, upon lookup
of either, you would have to iterate through the
bucket of items to find the key you are looking for.

My solution only removes a single key-value pair, and only removes a hash if it is empty, i.e. if it no longer contains any key-value pairs. And it seems to me that this is exactly how a hash table should behave.

The second should remove a key-value pair when
passed a key.

(If you copy-paste my code with all the tests into the freeCodeCamp editor you can see that the collisions are handled correctly.)