Skip to content

Branches - Eve #42

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Branches - Eve #42

wants to merge 4 commits into from

Conversation

tofuandeve
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? In terms of logic, there's not much of difference between too language, but they have different syntax (for loops in Javascript - times loops in Ruby for example). I used class keyword and static functions which act like class methods in Ruby.
Did you need to use different strategies to find information online about JavaScript than you would for Ruby? In stead of using Ruby doc, I used MDN web doc to read about JavaScript reference
What was a challenge you were able to overcome on this assignment? I learned that forEach loop won't stop even if return keyword is used. This took me about 20 minutes debugging but now I understand the difference between for loop and forEach loop
What has been interesting and positive about learning a new programming language? The syntax is different-ish, but the overarching concepts seem to be very much alike.
What is something to focus on your learnings in JavaScript in the next week? Practicing using array function maybe.

@CheezItMan
Copy link

JS Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions Check, glad you figured out the issues with forEach
Small commits with meaningful commit messages Good commit messages and granular commits
Code Requirements
drawLetters method Check
Uses appropriate data structure to store the letter distribution Check
All tests for drawLetters pass Check
usesAvailableLetters method Check
All tests for usesAvailableLetters pass Check
scoreWord method Check
Uses appropriate data structure to store the letter scores Check
All tests for scoreWord pass Check
Optional
highestScoreFrom method Check
Appropriately handles edge cases for tie-breaking logic Check
All tests for highestScoreFrom pass Check
Overall Well done! You hit all the learning goals here including the optionals. Nice work!

let output = [];
for (let key in lettersCounts) {
const value = lettersCounts[key];
for (let i = 0; i < value; i++) {

Choose a reason for hiding this comment

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

In general I suggest avoiding the use of an old-fashioned for loop, in favor of alternative loops. That said, it isn't bad for a counter like this loop.

return output;
}

static getRandomIndices(numberOfLetters, maxIndex) {

Choose a reason for hiding this comment

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

Since the method is more returning a set of random elements as opposed to random indices, I'd suggest naming this method getRandomElements

return indices;
}

static findIndex(array, element) {

Choose a reason for hiding this comment

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

There is an Array.find method.

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