Skip to content

London | 26-ITP-May | Zadri Abdule | Sprint 1 | Data groups#1238

Open
Zadri415 wants to merge 6 commits into
CodeYourFuture:mainfrom
Zadri415:sprint-1/coursework
Open

London | 26-ITP-May | Zadri Abdule | Sprint 1 | Data groups#1238
Zadri415 wants to merge 6 commits into
CodeYourFuture:mainfrom
Zadri415:sprint-1/coursework

Conversation

@Zadri415

@Zadri415 Zadri415 commented Jul 8, 2026

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

Changelist

fix: corrected calculateMedian in median.js and added tests
feat: implemented dedupe with tests (dedupe.js, dedupe.test.js)
feat: implemented findMax and tests (max.js, max.test.js)
test: added tests for sum (sum.test.js)
refactor: switched includes loop to for...of (includes.js)
feat: added AoC 2018 Day 1 solution (solution.js)

Questions

N/A

@Zadri415 Zadri415 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. Module-Data-Groups The name of the module. labels Jul 8, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good work on these tasks. I have some follow up questions

Comment thread Sprint-1/fix/median.js
// Keep only actual numbers. This filters out strings, null, undefined, objects, etc.
// We deliberately do not coerce numeric strings (e.g. "3") to numbers — tests expect
// non-number values to be ignored rather than parsed.
const numericList = list.filter((item) => typeof item === "number" && Number.isFinite(item));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What are you checking for here with isFinite?

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.

To check whether a value is a regular number.


// iterate in order; if unseen -> keep it
for (const item of arr) {
if (!seen.has(item)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you need to check if the set has an item before adding it?

Comment thread Sprint-1/implement/sum.js
function sum(elements) {
let total = 0;
for (let i = 0; i < elements.length; i++) {
if (typeof elements[i] === "number") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you know if there are any valid "number" types that you wouldn't be able to add together?

@LonMcGregor LonMcGregor 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 Jul 13, 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