-
Notifications
You must be signed in to change notification settings - Fork 20
Ocelot-Cindy Truong #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| export const drawLetters = () => { | ||
| // Implement this method for wave 1 | ||
| const letters = []; | ||
| let letter_pool_copy = { ...letterPool }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice use of spread syntax
| const letters = []; | ||
| let letter_pool_copy = { ...letterPool }; | ||
| let keys = Object.keys(letter_pool_copy); | ||
| while (letters.length < 10) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, this loop makes sense to me! I might like to see some sort of guard condition put in, in case of not being able to pick enough letters, so that it doesn't spin indefinitely if none are left available.
| let letter = wordArray[i]; | ||
| if (lettersInHandCopy.includes(letter)) { | ||
| // lettersInHandCopy.filter((item) => item !== letter); | ||
| lettersInHandCopy.splice(lettersInHandCopy.indexOf(letter), 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, a javascript 'remove' function ;) (referring to your project reflection comments.)
Good solution!
No description provided.