Skip to content

London | ITP MAY | Jamal Laqdiem | Module Data Groups | Sprint-2 #588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jemaljemy
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

This pull request addresses several bug fixes and introduces new functionalities within the Module-Data-Groups . The changes include improvements to existing exercises and the implementation of new core functions.

Questions

Ask any questions you have for your reviewer.

@jemaljemy jemaljemy added Needs Review Participant to add when requesting review 📅 Sprint 2 Assigned during Sprint 2 of this module labels Jul 12, 2025
@AdnanGondal AdnanGondal added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 19, 2025
@AdnanGondal AdnanGondal self-requested a review July 19, 2025 10:26
@AdnanGondal AdnanGondal removed the Needs Review Participant to add when requesting review label Jul 19, 2025
//test 1:
const result1 = invert({a:1});
const expected1 = {1:'a'};
console.log(`Test 1: Input {a:1}, Expected ${JSON.stringify(expected1)}, Actual ${JSON.stringify(result1)}`);

Choose a reason for hiding this comment

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

Why did you use JSON.stringify() here? What does it do and what benefit does it provide?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for reviewing, I used JSON.stringify() for readability and consistency, which it make it easy to read, compare and copy-paste.


}

console.log(contains({first_name :'john'}, 'first_name'))

Choose a reason for hiding this comment

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

Since you have all of these test cases inside your contains.test.js folder, wouldn't it be cleaner to remove all the console.log lines in this file?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for reviewing, yes you are right, i will remove them.

});
});

test("ignores empty key-value pairs created by multiple '&'", () => {

Choose a reason for hiding this comment

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

Can you add an extra line to this test to check:

expect(Object.keys(result)).not.toContain("");

Let me know what happens, and why so?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for reviewing, It ensures that the object keys are properly formed and don't contain empty or invalid name,and preventing empty string keys, and make the test more robust.

throw new Error ('Error parameter must be an array.')
}
for(count of arr) {
objectResult[count]= (objectResult[count] || 0) +1 ;

Choose a reason for hiding this comment

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

Very clever solution - well done

Copy link
Author

Choose a reason for hiding this comment

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

thanks for reviewing.

Copy link

@AdnanGondal AdnanGondal left a comment

Choose a reason for hiding this comment

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

Overall a great submission - but have added some comments and changes to do. Once done, let me know and I'll re-review.

@AdnanGondal AdnanGondal added Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 19, 2025
@jemaljemy jemaljemy added the Needs Review Participant to add when requesting review label Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review Participant to add when requesting review Reviewed Volunteer to add when completing a review 📅 Sprint 2 Assigned during Sprint 2 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants