Skip to content

Conversation

morganschuler
Copy link

JS Adagrams

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What patterns were you able to use from your Ruby knowledge to apply to JavaScript? I was able to use similar patterns such as hashes to objects, similar types of loops (although executed differently in JS).
Did you need to use different strategies to find information online about JavaScript than you would for Ruby? I think that I more or less use similar strategies. With ruby I would refer to my notes often, but since I am such a beginner in JS I find myself looking for more material to reference online.
What was a challenge you were able to overcome on this assignment? I think the biggest challenge was just understanding the different syntax and seeing how to carry it over to JS. Because everything can't be translated over perfectly from Ruby, it took some practice to be able to find comparable ways of achieving the desired result in JS.
What has been interesting and positive about learning a new programming language? I think it's really interesting to see the shortcuts that are present in another language - for example ruby doesn't have anything like arrow functions. Although these present a challenge, it's exciting to see logic executed in a different language.
What is something to focus on your learnings in JavaScript in the next week? More advanced syntax - I think now I better understand variables and loops but I would like to feel really comfortable with arrow functions, etc. that are not present in ruby.

@beccaelenzil
Copy link

JS Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions yes
Small commits with meaningful commit messages whoops, you forgot :)
Code Requirements
drawLetters method
Uses appropriate data structure to store the letter distribution yes
All tests for drawLetters pass yes
usesAvailableLetters method
All tests for usesAvailableLetters pass yes
scoreWord method
Uses appropriate data structure to store the letter scores yes
All tests for scoreWord pass yes
Optional
highestScoreFrom method
Appropriately handles edge cases for tie-breaking logic didn't address this -- was this intentional? The start to highestScoreFrom looks good.
All tests for highestScoreFrom pass no
Overall Great work on this project! In this project you’ve taken some interesting logic and worked it into JavaScript syntax. I’m adding a few comments for you to review, but overall you’ve done a great job of practicing syntax.

@@ -1,7 +1,138 @@

const allLettersLookup = {
"A": 9,

Choose a reason for hiding this comment

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

You can simply write

{
A: 9,
B: 2,
...
}

without " "


const drawnLetters = [];
for (let i = 0; i < 10; i++) {
drawnLetters.push(allLetters[Math.floor(Math.random() * allLetters.length)]);

Choose a reason for hiding this comment

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

There's a small bug here. Think about what you need to keep you from selecting the same letter 10 times.

letterLookup[letter] = (letterLookup[letter] || 0) + 1;
});

for (const letter of word) {

Choose a reason for hiding this comment

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

nice use of a for..of loop!

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