Skip to content

Manchester | 26-ITP-Sep | Rahana Suleiman | Sprint 2 | Sprint2-exercises (Module-Data-Groups) - #1509

Open
rahanasuleiman8-ship-it wants to merge 18 commits into
CodeYourFuture:mainfrom
rahanasuleiman8-ship-it:sprint-2
Open

rahanasuleiman8-ship-it wants to merge 18 commits into
CodeYourFuture:mainfrom
rahanasuleiman8-ship-it:sprint-2

Conversation

@rahanasuleiman8-ship-it

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

Task code

CYF-1083

Changelist

This PR completes Sprint 2 of Module-Data-Groups by implementing and testing core data and object manipulation functions—including property validation, query string parsing, lookup creation, frequency tallying, and object inversion—alongside comprehensive Jest unit tests.

@rahanasuleiman8-ship-it rahanasuleiman8-ship-it added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 10, 2026

@cjyuan cjyuan left a comment

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.

Code looks good. Well done.

I just have a few comments.

Comment thread Sprint-2/implement/contains.js Outdated
}

// Check if the object has the specified property key
return Object.prototype.hasOwnProperty.call(obj, propertyName);

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: Could also use Object.hasOwn().

Comment thread Sprint-2/implement/contains.test.js Outdated
Comment on lines +69 to +75
});
})





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.

Why not use a formatter to keep the code consistently formatted? They could help remove unnecessary trailing newlines and terminate statements with semicolon.

Comment thread Sprint-2/implement/querystring.js Outdated
function parseQueryString(queryString) {
const queryParams = {};
if (queryString.length === 0) {
if (!queryString || queryString.length === 0) {

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.

What does !queryString evalutes to when its length is 0?

@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 11, 2026
@rahanasuleiman8-ship-it

Copy link
Copy Markdown
Author

Hi @cjyuan, thank you for the review and helpful feedback!

I've pushed the updates to address all your comments:

  • Updated contains.js (and querystring.js) to use Object.hasOwn().
  • Formatted contains.test.js with Prettier to clean up the trailing newlines and semicolons.
  • Simplified the empty string check in querystring.js to if (!queryString) (since an empty string with length 0 is false and already evaluates !queryString to true).

Ready for another look whenever you have a moment!

@rahanasuleiman8-ship-it rahanasuleiman8-ship-it 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 14, 2026

@cjyuan cjyuan left a comment

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.

Changes to the code look good.


Note:

Some files still have trailing empty lines and some files do not have a trailing newline on the last line.

Prettier could usually take care of such inconsistency.

Comment on lines +70 to +71
});
}); No newline at end of file

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.

For more context about last line not terminating with a newline character, please refer to Why GitHub PRs Show That Red Circle: Understanding Newlines at End of Files.

@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 15, 2026
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.

2 participants