This project was super fun and very doable for someone at my level. Took me 2-3 hours. Open to feedback and fun feature ideas!
Hi @beta5125905023 !
Nice job! Would you like a challenge?
What about this:
- Instead of
inputs
being an array, make it an object. - Avoid creating all those const variables with strings values. Use the names of the variables as properties of
inputs
and use the literal strings as their values inside the object. - In order to get a random name, you need to pass an array to
getRandomItem()
. Check the methodObject.keys()
, so you can use its returned value when using it like:Object.keys(inputs)
. MDN. - With the array of keys, you can get a random key and use it to access inputs[randomKey]. Now you can set your
name
variable and your program doesn’t create a lot of variables.
If you try it, I’m here to help
1 Like