Skip to content

Sheffield | 26-Jan-ITP | Martha Ogunbiyi| Sprint 2| Coursework/sprint 2 - #1133

Closed
marthak1 wants to merge 15 commits into
CodeYourFuture:mainfrom
marthak1:coursework/sprint-2
Closed

Sheffield | 26-Jan-ITP | Martha Ogunbiyi| Sprint 2| Coursework/sprint 2#1133
marthak1 wants to merge 15 commits into
CodeYourFuture:mainfrom
marthak1:coursework/sprint-2

Conversation

@marthak1

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

Sprint 2 coursework done

@marthak1 marthak1 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 28, 2026
Comment thread Sprint-2/debug/author.js
Comment thread Sprint-2/implement/contains.js Outdated
Comment thread Sprint-2/implement/contains.test.js
Comment thread Sprint-2/implement/contains.js Outdated
Comment thread Sprint-2/implement/querystring.js
Comment thread Sprint-2/implement/tally.js Outdated
Comment thread Sprint-2/implement/tally.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 31, 2026
@marthak1 marthak1 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 6, 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 look good. Just one more question.

Comment thread Sprint-2/implement/contains.js Outdated
obj === null ||
typeof obj !== "object" ||
Array.isArray(obj) ||
Object.getPrototypeOf(obj) !== Object.prototype

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 is the purpose of the condition on line 6?

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.

Thanks for feedback. Line 6 ensures the function also reject non plain objects like Map, Set , Date etc.

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 about an empty object created from Object.create(null)? Do you plan to reject that kind of object as well?

Note: Prototype is a relatively advanced concept in JS programming. If you have to use it, use it with care.

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.

Thanks for the feedback, I never thought about about objects created with no prototypes at all on this case. function has now been updated.

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

cjyuan commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

All good.

@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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants