-
Notifications
You must be signed in to change notification settings - Fork 112
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
Sea Turtles - Shannon Bellemore - js adagrams #117
base: main
Are you sure you want to change the base?
Conversation
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.
Found the bug, Shannon! Look at my comment on your test file. I left a few other comments. Let me know if you have any questions.
}; | ||
|
||
export const usesAvailableLetters = (input, lettersInHand) => { | ||
// Implement this method for wave 2 | ||
}; | ||
let letterHandCopy = JSON.parse(JSON.stringify(lettersInHand)); |
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 see that you found out how to make a deep copy in JS! Here is an article I found with multiple ways to make a copy of an array: https://www.freecodecamp.org/news/how-to-clone-an-array-in-javascript-1d3183468f6a/
// Implement this method for wave 2 | ||
}; | ||
let letterHandCopy = JSON.parse(JSON.stringify(lettersInHand)); | ||
for (let i = 0; i < input.length; 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.
since i
isn't being reassigned we can use const here
if(word.length >= 7) { | ||
score += 8; | ||
} |
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 can refactor this to let score = word.length >= 7 ? 8 : 0;
and replace line 68 with it
@@ -133,7 +135,7 @@ describe("Adagrams", () => { | |||
}); | |||
}); | |||
|
|||
describe.skip("highestScoreFrom", () => { | |||
describe("highestScoreFrom", () => { |
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.
Your test is failing because you need to add an assertion on line 150
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.
Ohhhhh!! I even checked over the tests to see if I was missing filling in something since we had to complete one of the other tests, but I guess I missed it! 😭
No description provided.