Skip to content

London | 26-ITP-Sep | Shirin Panahian | Sprint 2| Complete sprint 2 exercises - #1516

Open
shirinpanahian wants to merge 8 commits into
CodeYourFuture:mainfrom
shirinpanahian:Sprint-2
Open

shirinpanahian wants to merge 8 commits into
CodeYourFuture:mainfrom
shirinpanahian:Sprint-2

Conversation

@shirinpanahian

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

Task code

CYF-1083

Changelist

This PR includes my work for Sprint 2 of the Module Data Groups project.

  • Debug: Analysed the existing code, predicted and explained the bugs, ran the files using Node.js, and fixed the issues.
  • Implement: Worked on implementing functions based on the provided requirements, including contains, lookup, tally, and querystring. Tested the functions with different inputs to verify their behaviour.
  • Interpret: Worked through the provided programs to understand unfamiliar JavaScript syntax, operators, and functions using documentation and console.log().

This sprint helped me improve my JavaScript problem-solving, debugging, implementation, and code-reading skills.

@shirinpanahian shirinpanahian 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 Nov 12, 2026
@valentina-starr1

Copy link
Copy Markdown

Thank you for this PR. Great work completing the Sprint 2 exercises and adding tests.

I can see two small JavaScript edge cases to fix before merging:

tally.js (line 12): Plain objects inherit built-in keys like toString, so tally(["toString"]) tries to add 1 to a function instead of returning { toString: 1 }. Using Object.hasOwn() or Object.create(null) fixes this.

querystring.js (line 38): Assigning "proto" directly to a normal object changes its prototype instead of saving it as a key. Using Object.create(null) or Object.defineProperty() handles it safely.

@shirinpanahian

Copy link
Copy Markdown
Author

Thank you for the feedback and the helpful explanations!

I've fixed both edge cases using Object.hasOwn() in tally.js and Object.create(null) in querystring.js.

I've also added tests to cover these cases and pushed the updates to the PR.

Thanks again for the review!

Thank you for this PR. Great work completing the Sprint 2 exercises and adding tests.

I can see two small JavaScript edge cases to fix before merging:

tally.js (line 12): Plain objects inherit built-in keys like toString, so tally(["toString"]) tries to add 1 to a function instead of returning { toString: 1 }. Using Object.hasOwn() or Object.create(null) fixes this.

querystring.js (line 38): Assigning "proto" directly to a normal object changes its prototype instead of saving it as a key. Using Object.create(null) or Object.defineProperty() handles it safely.

@shirinpanahian shirinpanahian added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants