Skip to content

Conversation

@ldfajardo10-tech
Copy link

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

I forget to do a branch for the fix exercise so I added to the implement branch.
Exercises in this branch:

  • fix/median
  • dedupe/implement
  • max/implement
  • sum/implement

@fgsumer
Copy link

fgsumer commented Dec 31, 2025

@ldfajardo10-tech
Overall, nice work.

There are some changes needed.
Can you update your code based on the feedback below, please?

For findMax() tests

  • "-infinity" is a string, not the expected numeric constant
    return "-infinity";
  • You’re using brackets instead of parentheses to call the function in all tests:
    findMax[50] // Incorrect
  • Use .toBe() for primitive values like numbers
    expect(findMax(["5", "hello", "a2"])).toEqual("-infinity"); // Incorrect

For sum() test cases:

  • Update all sum[...] calls to use parentheses and arrays: sum([ ... ]).
  • Fix the incorrect expected value in the tests:
    expect(sum([NaN, null, "hello"])).toEqual(55); // 55 incorrect
    expect(sum[10, 20, 35]).toEqual(85); // 85 incorrect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants