Conversation
| @@ -1,5 +1,55 @@ | |||
| function scrabble() { | |||
| function scrabble(words) { | |||
There was a problem hiding this comment.
words is not correct, the variable represents 1 scrabble word so the name for the variable is better as word
| function scrabble(words) { | ||
| // write code here | ||
| } | ||
| const dictionary = { |
There was a problem hiding this comment.
the name of this variable doesnt tell me what it represents / stores, a better name would be SCRABBLE_LETTER_SCORES since it is representing a fixed-value piece of data that you only read from. You can move it outside the function since it is constant and read-only.
| Y: 4, | ||
| Z: 10 | ||
| } | ||
| let fullTotal = 0 |
There was a problem hiding this comment.
fullTotal variable name could improve because it doesnt tell me what it is, i don't know what full total means... perhaps wordTotalScore would be better or totalScore
| return 0 | ||
| } | ||
|
|
||
| if (words === null) { |
There was a problem hiding this comment.
this if statement should be the first of the 3 that check whether the word is valid
| } | ||
|
|
||
| for (let index = 0; index < words.length; index++) { | ||
| let wordsCapit = words[index].toUpperCase() |
There was a problem hiding this comment.
this variable is not correctly named: it isn't a word capitalised, it's the character capitalised...
No description provided.