Skip to content

London | 26-ITP-Sept | Fung Nin Lee | Sprint 1 | Sprint-1 exercise - #1496

Open
leerogerfn wants to merge 19 commits into
CodeYourFuture:mainfrom
leerogerfn:Sprint-1
Open

leerogerfn wants to merge 19 commits into
CodeYourFuture:mainfrom
leerogerfn:Sprint-1

Conversation

@leerogerfn

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-1071

Changelist

completed exercises of Data Group Sprint-1

@leerogerfn leerogerfn added 📅 Sprint 1 Assigned during Sprint 1 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 5, 2026
@cjyuan cjyuan added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 5, 2026
Comment thread Sprint-1/fix/median.js Resolved
Comment thread Sprint-1/fix/median.js Resolved
Comment thread Sprint-1/fix/median.js Resolved
Comment thread Sprint-1/implement/dedupe.test.js Resolved

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.

  • How should the function handle an array containing NaN?

  • How should the function handle an array containing elements that are not numbers or strings (e.g., null, undefined, true, console (object), etc.)?

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.

The assessment seems do not require to handle NaN and array which are neither numbers nor strings.

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.

  • NaN is also a value of type "number". Handling NaN is optional in this exercise but you should find out how to check if a value is not NaN.

  • The comment in max.test.js does mention "any value that isn't a number"

     // Given an array containing a value that isn't a number
     // When passed to the max function
     // Then it should throw Error("findMax requires an array of numbers")
    

    So the function should also be able to throw an error when the given array contains any value that is not a number.

Comment thread Sprint-1/implement/mean.js Resolved

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 should calculateMean([Infinity, 0, -Infinity]) or calculateMean([0, NaN]) return?
The same also applies to sum().

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.

The assessment seems do not require to handle the scenario you mentioned.

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.

-Infinity and Infinity are also values of type "number". Change is optional, but you should find out how to check if a number is not one of them.

Comment thread Sprint-1/implement/mean.test.js Resolved
@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Nov 5, 2026
@leerogerfn leerogerfn added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 6, 2026
Comment thread Sprint-1/fix/median.js Resolved
Comment thread Sprint-1/implement/describe-median.js Resolved
Comment thread Sprint-1/implement/dedupe.test.js Resolved
@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 6, 2026
@leerogerfn leerogerfn added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 8, 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, but some of the code is not consistently formatted.

Suggestion:

  • Look up the benefits of using a code formatter.
  • Install the Prettier extension for VS Code, then:
    • Use VS Code's Format Document feature to format your code.
    • Optionally, enable Format On Save and Format On Paste to keep your code consistently formatted.

Resource: Visual Studio Code - Formatting

Note: The formatter may not work correctly if your code contains syntax errors.

@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 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-Groups The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants