Skip to content

London | ITP-May-2025 | Sisay Mehari | Module-Data-Groups | Sprint 1 #556

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 9 commits into
base: main
Choose a base branch
from

Conversation

Sisu860
Copy link

@Sisu860 Sisu860 commented Jul 5, 2025

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

✅ Completed Work Summary
This pull request includes completed implementations and refactors across several array utility functions, with full test coverage and a stretch challenge solution from Advent of Code.

📦 Core JavaScript Functions

  1. dedupe.js
    Removes duplicate values from arrays while preserving order.
    Tests cover:

Empty arrays

Arrays with and without duplicates

Arrays with mixed types (e.g., strings, numbers)

  1. max.js
    Finds the maximum numeric value in an array, ignoring non-numeric entries.
    Improved handling for:

Empty arrays (returns -Infinity)

Arrays with only non-numeric values

Negative and decimal numbers

  1. sum.js
    Calculates the sum of numeric values in an array, skipping non-numeric values.
    Tested with:

Empty arrays

Arrays with negative and decimal numbers

Arrays with only non-number elements

  1. median.js
    Computes the median of numeric values in an array.
    Enhancements include:

Skips non-numeric values

Returns null for empty or invalid arrays

Added comments and sample I/O for clarity

  1. includes.js (Refactor)
    Rewrote the includes function to use a more readable for...of loop instead of a traditional for loop.
    All original tests still pass.

🚀 Stretch Goal: Advent of Code 2018 - Day 1
solution.js
Implements calculateFrequency(changes) to compute resulting frequency from a list of changes like +1, -2, etc.

Starts from frequency 0

Handles input from file

Ensures all deltas are processed correctly

🧪 Testing
Comprehensive test coverage added for all updated and new functions.
Tests include:

Edge cases (e.g., empty arrays, invalid inputs)

Common use cases

Non-numeric filtering and robust input validation

Questions
None at the moment.

Sisu860 added 3 commits July 5, 2025 12:09
	modified:   Sprint-1/implement/dedupe.js
	modified:   Sprint-1/implement/dedupe.test.js
	modified:   Sprint-1/implement/max.js
	modified:   Sprint-1/implement/max.test.js
	modified:   Sprint-1/implement/sum.js
	modified:   Sprint-1/implement/sum.test.js
	modified:   Sprint-1/refactor/includes.js
	modified:   Sprint-1/stretch/aoc-2018-day1/solution.js
	modified:   Sprint-1/fix/median.js
@Sisu860 Sisu860 added Needs Review Participant to add when requesting review 📅 Sprint 1 Assigned during Sprint 1 of this module labels Jul 5, 2025
Copy link

Choose a reason for hiding this comment

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

tests passed, well done

Copy link

Choose a reason for hiding this comment

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

Tests passed, well done

Copy link

Choose a reason for hiding this comment

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

Tests passed, well done

Copy link

Choose a reason for hiding this comment

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

code looks fine

Copy link

Choose a reason for hiding this comment

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

consider how you would code to catch errors such as file not being available. just a consideration, w3 schools is a website with good information

@fearcyf
Copy link

fearcyf commented Jul 8, 2025

I can't see your median.tests file, please advise. Otherwise good work

@fearcyf fearcyf self-assigned this Jul 8, 2025
@fearcyf fearcyf added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Jul 8, 2025
@Sisu860 Sisu860 added the Needs Review Participant to add when requesting review label Jul 8, 2025
@Sisu860 Sisu860 requested a review from fearcyf July 10, 2025 20:10
Copy link

Choose a reason for hiding this comment

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

This would work, well done

Copy link

Choose a reason for hiding this comment

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

Each type of error can be identified and returned however that should be discussed later in the course. Do your own research in the meantime.

Copy link

Choose a reason for hiding this comment

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

Tests passed, well done

@fearcyf fearcyf removed the Needs Review Participant to add when requesting review label Jul 11, 2025
@Sisu860
Copy link
Author

Sisu860 commented Jul 12, 2025

I have made the changes. Can you please tag the complete label?

@fearcyf fearcyf added Complete Volunteer to add when work is complete and review comments have been addressed and removed Reviewed Volunteer to add when completing a review labels Jul 12, 2025
@fearcyf
Copy link

fearcyf commented Jul 12, 2025

Sisay, I have now added the Complete Tag. @cjyuan, this sprint 1 should be ready to go forward now.

@Sisu860
Copy link
Author

Sisu860 commented Jul 12, 2025

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed 📅 Sprint 1 Assigned during Sprint 1 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants