-
-
Notifications
You must be signed in to change notification settings - Fork 149
WM | Abdullah Saleh | Module-Data-Groups | Sprint2 #632
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: main
Are you sure you want to change the base?
WM | Abdullah Saleh | Module-Data-Groups | Sprint2 #632
Conversation
…int each item on a new line
…array and add test cases
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.
Good job. Some minor fixes here and there, and this PR should be good to go.
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.
Please add the missing comments as requested - you need to include your prediction of what the code will output and explain how to fix the issue.
Solution looks good! I think you can make some minor changes to make the output look better. Consider this formatting:
console.log(`${recipe.title} serves ${recipe.serves}, the ingredients required are:
${recipe.ingredients.join("\n")}`);
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.
Great work on the logic; the function works correctly
Just a small improvement: please remove the console.log(countryCurrencyPairs.length) statement inside the function, as well as the console.log(createLookup([])) call at the bottom of the file.
Console logs are helpful for debugging during development, but we usually remove them from the final version of the code to keep it clean.
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 have a test.todo not implemented in this file.
The todo test is the same as the last test you have in this file. I suggest you update the description of your test and remove the test.todo
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.
Let's remove console.log from this file also.
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 is a missing test in this file
// Given an invalid input like a string
// When passed to tally
// Then it should throw an error
|
||
console.log(tally(['a', 'a', 'b', 'a'])) |
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.
Good work on the logic;
- Let's remove the console.log in this file,
- There is also a missing implementation that checks if a valid input is passed. The test for this scenario is also not implemented.
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.
Great work! Your logic is solid, and you've tackled the advanced challenges well.
Main issue to fix:
Your code will create empty string keys when there are multiple spaces in the input. For example, "hello world" (with two spaces) will create an empty string key in your object.
Solution:
After splitting, filter out empty strings:
const stringsIntoArray = string.replace(punctuation, "").toLowerCase().split(" ").filter(word => word !== "");
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.
Good work on the refactoring! Can you remove the console.log line?
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.
Nice work! Just a small fix needed - change coin.slice("0", coin.length - 1) to coin.slice(0, coin.length - 1)
. The first argument needs to be a number, not a string.
Here's the MDN reference if helpful: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice"
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.