-
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
Caroline Nardi - JS Scrabble - Octos #34
base: master
Are you sure you want to change the base?
Conversation
…h loops to change scope of 'this'.
JS ScrabbleWhat We're Looking For
|
|
||
const Scrabble = { | ||
score(word) { | ||
if (!word || typeof word !== 'string' || word.length > 7) { | ||
throw new Error('Invalid input'); | ||
} |
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 that you're throwing full instances of Error
here. Throwing raw strings is tempting, but you don't get a full stack trace.
tieBreaker(first, second) { | ||
if (first.length === 7) { | ||
return first | ||
} else if (second.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.
Good use of a helper function to clarify this logic
JS Scrabble
Congratulations! You're submitting your assignment!
Comprehension Questions