Skip to content

Manchester | 26-ITP-May | Samreen Amjad | Sprint 2 | Exercises - #1292

Open
serveyano wants to merge 1 commit into
CodeYourFuture:mainfrom
serveyano:Module-Data-Groups-Sprint-2
Open

Manchester | 26-ITP-May | Samreen Amjad | Sprint 2 | Exercises#1292
serveyano wants to merge 1 commit into
CodeYourFuture:mainfrom
serveyano:Module-Data-Groups-Sprint-2

Conversation

@serveyano

Copy link
Copy Markdown

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]

(https://curriculum.codeyourfuture.io/guides/reviewing/style-guide/)

Changelist

Completed exercises for Sprint 2

@serveyano serveyano added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 2 Assigned during Sprint 2 of this module labels Jul 26, 2026
Comment on lines +1 to +3
function contains(array, target) {
return array.includes(target);
}

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.

Can this function pass the tests in contains.test.js?

}

// Replaces + with space
queryString = queryString.replaceAll("+", " ");

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.

Common practice is to declare another variable to store the converted string.

Comment on lines +13 to +15
let index = pair.indexOf("=");
if (!pair.includes("=")) {
index = pair.length;

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.

On line 14, checking the value of index is more efficient than calling .includes()

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.

This file should contain Jest test script to test the function define in querystring.js.

@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 Jul 30, 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. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants