Skip to content

Manchester | 26-ITP-Jan | Liban Jama | Sprint 2 | Data Groups #1050

Closed
libanj0161 wants to merge 12 commits into
CodeYourFuture:mainfrom
libanj0161:Data-Groups-Sprint-2
Closed

Manchester | 26-ITP-Jan | Liban Jama | Sprint 2 | Data Groups #1050
libanj0161 wants to merge 12 commits into
CodeYourFuture:mainfrom
libanj0161:Data-Groups-Sprint-2

Conversation

@libanj0161

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

Changelist

Completed Sprint 2 of Module Data Groups.

Questions

N/A.

@libanj0161 libanj0161 added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. labels Mar 19, 2026
Comment thread Sprint-2/debug/recipe.js Outdated
Comment thread Sprint-2/implement/contains.js
Comment thread Sprint-2/implement/contains.test.js
Comment thread Sprint-2/implement/contains.test.js Outdated
Comment thread Sprint-2/implement/lookup.js
Comment thread Sprint-2/implement/querystring.js Outdated
Comment thread Sprint-2/implement/tally.js Outdated
@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 25, 2026
@libanj0161 libanj0161 requested a review from cjyuan March 26, 2026 12:52
@libanj0161 libanj0161 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 26, 2026
@cjyuan

cjyuan commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Can you also respond to each comment to let me know what you did?

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 26, 2026
@libanj0161 libanj0161 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 26, 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.

Thanks for the clear explanations.

Changes look good.

I will mark this PR as complete first.

Comment thread Sprint-2/implement/contains.js Outdated
@@ -1,3 +1,9 @@
function contains() {}
function contains(object, propertyName) {
if (Object.prototype.toString.call(object) !== "[object Object]") {

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 check will reject other kinds of objects such as Map and Set objects.

Can you change it to reject only arrays or any value that is not an object?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added a rejection for null and array, and added test.
Made contains work with map/set.

@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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 26, 2026
@libanj0161 libanj0161 requested a review from cjyuan March 27, 2026 11:12
@libanj0161 libanj0161 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 27, 2026
Comment thread Sprint-2/implement/contains.js Outdated
Comment on lines +2 to +4
if (object instanceof Map || object instanceof Set) {
return object.has(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.

This is unnecessary because of the check on line 5.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

removed check for map/set

Comment thread Sprint-2/implement/contains.test.js Outdated
expect(contains(obj, "name")).toEqual(true);
});

test("should throw an error when input is an array even if propertyName is a valid key", () => {

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 function does not throw any error.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

updated test description

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 27, 2026
@illicitonion

Copy link
Copy Markdown
Member

Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it.

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. Module-Data-Groups The name of the module. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants