Skip to content

London | 26-ITP-Sep | Bartosz Kawiak | Sprint 2 | Sprint2-exercises - #1508

Open
bartoszkawiak wants to merge 3 commits into
CodeYourFuture:mainfrom
bartoszkawiak:Sprint2-branch
Open

bartoszkawiak wants to merge 3 commits into
CodeYourFuture:mainfrom
bartoszkawiak:Sprint2-branch

Conversation

@bartoszkawiak

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

Completed the latest Sprint 2 exercises, working with JavaScript objects, key-value pairs and loops. Added tests, fixed bugs and improved my understanding of how to work with objects.

Questions

I did not know if I should make a new test file for invert.js file or just write down tests below comments.

@bartoszkawiak bartoszkawiak 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 Nov 10, 2026
Comment thread Sprint-2/debug/address.js Resolved
Comment thread Sprint-2/debug/recipe.js Resolved
Comment thread Sprint-2/implement/contains.js Resolved
Comment thread Sprint-2/implement/querystring.js Resolved
Comment thread Sprint-2/interpret/invert.js Resolved
Comment on lines +41 to +48

test("when given single input should invert key and value eg. 'a:1', return '1:a' ", () => {
expect(invert({ a: 1 })).toEqual({ 1: "a" });
});

test("when given multiple inputs should invert key and values correctly ", () => {
expect(invert({ a: 1, b: 3 })).toEqual({ 1: "a", 3: "b" });
});

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.

In this exercise, you only need to interpret the code. Your answers to the questions are good.
The goal is to be able to distinguish the difference between these two syntax:

  • obj[key]
  • obj.key

Tests are optional and you could leave the test code here if you want.

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 explaining CJ. I'll keep the tests in a single file for better access.

@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 10, 2026
@bartoszkawiak bartoszkawiak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 11, 2026
@cjyuan

cjyuan commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Changes look good.

Thanks for responding to all comments clearly.

Well done.

@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 Nov 11, 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. 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.

2 participants