Skip to content

London | 26-ITP-May | Vito Moratti | Sprint 2 | Coursework - #1364

Open
vmoratti wants to merge 17 commits into
CodeYourFuture:mainfrom
vmoratti:Module-Data-Groups/Sprint-2
Open

London | 26-ITP-May | Vito Moratti | Sprint 2 | Coursework#1364
vmoratti wants to merge 17 commits into
CodeYourFuture:mainfrom
vmoratti:Module-Data-Groups/Sprint-2

Conversation

@vmoratti

@vmoratti vmoratti commented Aug 3, 2026

Copy link
Copy Markdown

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

I attempted all tasks except the stretch

@vmoratti vmoratti added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 3, 2026
Comment thread Sprint-2/debug/author.js Outdated
Comment thread Sprint-2/implement/contains.js Outdated
Comment thread Sprint-2/implement/contains.test.js
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 Aug 8, 2026
@vmoratti vmoratti added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 9, 2026
Comment on lines 42 to 47
// Given invalid parameters like an array
// When passed to contains
// Then it should return false or throw an error
test("contains an object returns true, or false otherwise", () => {
expect(contains([1, 2, 3, 'a'], "a")).toBe(false);
expect(contains([1, 2, 3, 'a'], "0")).toBe(false);
});

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.

Invalid parameters also include values like null, undefined, 1234, true. Could your function also return false when the first argument is one of these values?

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.

I have added extra validation to the contains() function now.
I believe it was not in the instruction, nor in the tests, that's why i didn't add them initially.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 9, 2026
Refactor contains function to handle null, undefined, and Number types.
@vmoratti vmoratti added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 9, 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. Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants