Skip to content

Conversation

@HadiVahidi20
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 have done every thing in sprint 2

Questions

no question thank you so much

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

Your PR's title didn't contain a known region.

Please check the expected title format, and make sure your region is in the correct place and spelled correctly.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@HadiVahidi20 HadiVahidi20 changed the title West Midland | ITP-Sept-2025 | Hadi Vahidi | Sprint 2 | Module Data Groups West Midlands | ITP-Sept-2025 | Hadi Vahidi | Sprint 2 | Module Data Groups Dec 6, 2025
@HadiVahidi20 HadiVahidi20 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Dec 13, 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.

Please revert the changes made in the "Sprint-1" folder, as they are not related to Sprint-2 exercise.

Copy link
Contributor

Choose a reason for hiding this comment

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

Have you run this script to test your function implementation?

// When passed to contains
// Then it should return false or throw an error
test("contains returns false for invalid input", () => {
expect(contains([], "a")).toBe(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Arrays are objects in JavaScript, and they do have property names -- just not the same ones as objects.
Which keys do arrays have, and how does that affect how reliable your test is?

When testing whether the function handles arrays properly, try using a key that an array might
realistically contain
. Otherwise, you might get a passing test even if the function isn't checking for arrays at all.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can this script even run?


const key = pair.substring(0, index); // before the =
const value = pair.substring(index + 1); // after the =
queryParams[key] = value;
Copy link
Contributor

Choose a reason for hiding this comment

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

In real query string, both key and value are percent-encoded or URL encoded.
For example,

tags%5B%5D=hello%20world -> key is tags[], value is hello world

Can your function handle URL-encoded query string?

Suggestion: Look up "How to decode a URL-encoded string in JavaScript".

throw new Error("Input must be an array");
}

const counts = {};
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.

@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 Dec 14, 2025
@HadiVahidi20 HadiVahidi20 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 Dec 20, 2025
@illicitonion illicitonion 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 Dec 21, 2025
@illicitonion
Copy link
Member

Well done!

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