-
Notifications
You must be signed in to change notification settings - Fork 50
Branches-Sara #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
base: master
Are you sure you want to change the base?
Branches-Sara #44
Conversation
JS AdagramsWhat We're Looking For
|
} else { | ||
return false; | ||
} | ||
}); | ||
}, |
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.
There should be a return true;
before the end of the function. As is the function is not returning anything if it hasn't already returned false.
let word = input.toLowerCase().split(""); | ||
let sameLetters = shuffle(lettersInHand); | ||
|
||
word.forEach(function(letter) { | ||
if (sameLetters.includes(letter)) { | ||
let letterLocation = sameLetters.indexOf(letter); | ||
sameLetters.splice(letterLocation, 1); | ||
} else { | ||
return false; | ||
} |
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 am surprised to realize 2 of the 3 tests still fail when I add the return statement mentioned below. There are several bugs in this code that it'd be good for us to talk about during our 1:1 next week.
|
||
let maxWordScore = 0; | ||
let maxWord = ""; | ||
winningWordLetterCount = 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.
needs a let
winningWordLetterCount = 0; | ||
|
||
words.forEach(function(word) { | ||
if (scoreWord(word) > maxWordScore) { |
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.
This function doesn't successfully run. Each call to the scoreWord function should be called with Adagrams.scoreWord
JS Adagrams
Congratulations! You're submitting your assignment!
Comprehension Questions