Skip to content

Comments

Olaoluwa Oyebode_Pull Request#224

Open
olaolumcpaul wants to merge 3 commits intoboolean-uk:mainfrom
olaolumcpaul:main
Open

Olaoluwa Oyebode_Pull Request#224
olaolumcpaul wants to merge 3 commits intoboolean-uk:mainfrom
olaolumcpaul:main

Conversation

@olaolumcpaul
Copy link

No description provided.

function scrabble(word) {
if (!word || typeof word !== 'string' || word.trim() === '') return 0

const scores = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can go outside the function; since it is constant variable that is read-only..

you can also rename it as SCRABBLE_SCORES or SCRABBLE_LETTER_SCORES to indicate that it is read only and be more specific about what it represents

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all noted.

src/scrabble.js Outdated
let totalScore = 0
const upperCaseWord = word.toUpperCase()

for (let i = 0; i < upperCaseWord.length; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants