Skip to content

London | 26-ITP-Jan | Maryanne Mosonik | Sprint 2 | Module Data Groups#1101

Open
Maryanne-K wants to merge 13 commits intoCodeYourFuture:mainfrom
Maryanne-K:Sprint_2
Open

London | 26-ITP-Jan | Maryanne Mosonik | Sprint 2 | Module Data Groups#1101
Maryanne-K wants to merge 13 commits intoCodeYourFuture:mainfrom
Maryanne-K:Sprint_2

Conversation

@Maryanne-K
Copy link
Copy Markdown

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

Corrected and completed the implementations and jest test cases.

@github-actions

This comment has been minimized.

@Maryanne-K Maryanne-K closed this Mar 25, 2026
@Maryanne-K Maryanne-K reopened this Mar 25, 2026
@github-actions

This comment has been minimized.

@Maryanne-K Maryanne-K closed this Mar 25, 2026
@Maryanne-K Maryanne-K reopened this Mar 25, 2026
@github-actions

This comment has been minimized.

@Maryanne-K Maryanne-K closed this Mar 25, 2026
@Maryanne-K Maryanne-K reopened this Mar 25, 2026
@Maryanne-K Maryanne-K marked this pull request as ready for review March 25, 2026 23:43
@Maryanne-K Maryanne-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 25, 2026
Copy link
Copy Markdown
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.

test.todo(" ... ") is just a placeholder to serve as a reminder for "what needs to be done".
In this exercise, that means "implementing the corresponding Jest tests described in the comments."

Can you replace them (in all .test.js files) with actual Jest tests?

console.log(`${recipe.title} serves ${recipe.serves}
ingredients:
${recipe}`);
${recipe.ingredients}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The requirement on line 4 has not yet been met:

Each ingredient should be logged on a new line

if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
return false;
}
return key in obj;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider the following two approaches for determining if an object contains a property:

  let obj = {}, propertyName = "toString";
  console.log( propertyName in obj );                // true
  console.log( Object.hasOwn(obj, propertyName) );   // false

Which of these approaches suits your needs better?
For more info, you can look up JS "in" operator vs Object.hasOwn.

} else {
const key = pair.substring(0, index);
const value = pair.substring(index + 1);
queryParams[key] = value;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note: (No change required)

  • In real query string, both key and value are percent-encoded or URL encoded in the URL.
    For example, the string "5%" is encoded as "5%25". So to get the actual value of "5%25"
    (whether it is a key or value in the query string), we need to call a function to decode it.

  • You can also explore the URLSearchParams API.

Comment on lines +5 to +12
const counts = {};
for (const item of arr) {
if (counts[item]) {
counts[item] += 1;
} else {
counts[item] = 1;
}
}
Copy link
Copy Markdown
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.

@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 Mar 26, 2026
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 with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants