-
Notifications
You must be signed in to change notification settings - Fork 42
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
Kiera - jsscrabble - Octos #28
base: master
Are you sure you want to change the base?
Conversation
…ne test is passing.
JS ScrabbleWhat We're Looking For
|
if (word_score[word] > highest_score) { | ||
highest_score = word_score[word]; | ||
winWord = word; | ||
} if (word_score[word] === highest_score && winWord.length === 7) { |
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.
These conditionals are structured like you want them to be nested in the else ifs, but they're all independent conditions. Recommend switching to else if
} else { | ||
let word_score = {}; | ||
arrayOfWords.forEach(function(word) { | ||
word_score[word] = Scrabble.score(word); |
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.
I like the way you're storing the scores in an object so you don't need to recalculate the scores each time
JS Scrabble
Congratulations! You're submitting your assignment!
Comprehension Questions