How can I prevent the random number generator from creating a race number that was previously given to someone?

Hello,
I just finished the Race day project —> https://www.codecademy.com/courses/introduction-to-javascript/projects/race-day <— and I couldn’t help to notice there was still an unsolved problem in the project’s hipothetical situation. Two runners can still get the same race number, since it’s a random generator. Is there a way to fix this?

Thank you.

1 Like

You can’t.

Remove the picked value from the possible choices, or re-roll on duplicate.

2 Likes