Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eggoweggo
Copy link

No description provided.

Copy link

@tgoslee tgoslee left a 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));
Copy link

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++) {
Copy link

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

Comment on lines +76 to +78
if(word.length >= 7) {
score += 8;
}
Copy link

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", () => {
Copy link

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

Copy link
Author

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! 😭

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