Skip to content

Conversation

@anosidium
Copy link

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I completed all the exercises and skipped the stretch exercises

Questions

I’d like to point out the parseQueryString() function, we should ensure it properly handles percent-encoded characters (e.g., %3D for = and %2B for +).

@anosidium anosidium added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 12, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Great work. I just have a few suggestions.

Comment on lines 1 to 9
function tally(array) {
if (!Array.isArray(array)) throw new Error("array is not an array!");

return array.reduce((accumulator, currentValue) => {
const value = accumulator[currentValue];
accumulator[currentValue] = value ? value + 1 : 1;
return accumulator;
}, {});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the following function call returns the value you expect?

tally(["toString", "toString"]);

Suggestion: Look up an approach to create an empty object with no inherited properties.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review, I didn't know about this particular case! 😮

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 21, 2025
@anosidium anosidium added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 21, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

All good! Well done.

console.log(
`titie: ${recipe.title}, serves: ${
recipe.serves
}, ingredients: ${recipe.ingredients.join(", ")}`
Copy link
Contributor

Choose a reason for hiding this comment

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

The requirement is "Each ingredient should be logged on a new line". :D

Copy link
Author

Choose a reason for hiding this comment

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

Oops! Then why did you suggest Array.prototype.join()? My original implementation did exactly that.

Copy link
Contributor

Choose a reason for hiding this comment

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

You could join with new line character.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants