Conversation
dogezen
left a comment
There was a problem hiding this comment.
all your code is missing comments - it makes it hard for me to review because I have to analyise each line of code and really think hard about what each line does
with comments you make other people's lives much easier in terms of understanding and reflecting on your code
src/scrabble.js
Outdated
| // write code here | ||
| const modifiers = ['{', '}', '[', ']'] | ||
| let totalPoints | ||
| const points = { |
There was a problem hiding this comment.
when we have constants: variables storing contant data that is fixed:
const SCRABBLE_POINTS = { ... }
src/scrabble.js
Outdated
| z: 10 | ||
| } | ||
|
|
||
| function scrabble(input) { |
There was a problem hiding this comment.
input doesn't tell me what the variable is: it would be better named as inputWord
| } | ||
|
|
||
| function scrabble(input) { | ||
| totalPoints = 0 |
There was a problem hiding this comment.
why is totalPoints defined outside the function and not created inside the function?
src/scrabble.js
Outdated
| @@ -1,5 +1,103 @@ | |||
| function scrabble() { | |||
| // write code here | |||
| const modifiers = ['{', '}', '[', ']'] | |||
There was a problem hiding this comment.
same as scrabble points: i'd name these as WORD_MODIFIERS
src/scrabble.js
Outdated
| } | ||
|
|
||
| if (modifiers.some((mod) => input.includes(mod))) { | ||
| square(input) |
There was a problem hiding this comment.
unsure what square() and bracket() do -> function names are ambiguous, they should be more descriptive about telling me what the function does
src/scrabble.js
Outdated
| z: 10 | ||
| } | ||
|
|
||
| function scrabble(input) { |
There was a problem hiding this comment.
function name ambiguous, better: computeScrabbleScore
No description provided.