Skip to content

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

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

Conversation

3bdullah-saleh
Copy link

@3bdullah-saleh 3bdullah-saleh commented Jul 16, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@3bdullah-saleh 3bdullah-saleh added the Needs Review Participant to add when requesting review label Jul 16, 2025
@oluwatunmiisheii oluwatunmiisheii added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Participant to add when requesting review labels Jul 19, 2025
Copy link

@oluwatunmiisheii oluwatunmiisheii left a 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.

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")}`);

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.

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

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.

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']))

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;

  1. Let's remove the console.log in this file,
  2. There is also a missing implementation that checks if a valid input is passed. The test for this scenario is also not implemented.

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 !== "");

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?

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"

@oluwatunmiisheii oluwatunmiisheii added Needs Review Participant to add when requesting review Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. Needs Review Participant to add when requesting review labels Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants