-
Notifications
You must be signed in to change notification settings - Fork 44
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
Kelly Tran: Scrabble JS #41
base: master
Are you sure you want to change the base?
Conversation
highestScore = wordScore; | ||
} | ||
else if (highestScore === wordScore && highestWord.length !== 7 && highestWord.length > wordLen ) { | ||
highestWord = arrayOfWords[i]; |
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.
You're using the arrayOfWords[i]
variable a bunch so it might be good to assign it to a variable to make the code more readable.
}; | ||
|
||
this.highestScoreFrom = function(arrayOfWords) { | ||
var highestWord = arrayOfWords[0]; |
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 job using the score of the first word to ensure accurate results
|
||
// hasWon(): Function which returns true if the player has over 100 points, otherwise returns false | ||
Player.prototype.hasWon = function() { | ||
if (this.totalScore() > 100) { |
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! Note: you can use ternary operators (using the ?
) in JS
I did it! Yay! Thank you for the deadline extension and arranging a tutor for me! @kariabancroft @droberts-ada