Skip to content

Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Data Groups Refactor#1004

Open
Richiealx wants to merge 1 commit intoCodeYourFuture:mainfrom
Richiealx:coursework/sprint-1-refactor
Open

Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Data Groups Refactor#1004
Richiealx wants to merge 1 commit intoCodeYourFuture:mainfrom
Richiealx:coursework/sprint-1-refactor

Conversation

@Richiealx
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

Changelist

This pull request contains my solution for the Sprint 1 - Refactor exercise in the Module Data-Groups.

Refactor

Refactored the implementation of the includes function in:

  • Sprint-1/refactor/includes.js

Changes made:

  • Replaced the indexed for loop with a for...of loop
  • Simplified the implementation while keeping the same behaviour
  • Ensured the function still checks whether the target value exists in the array

The existing test cases in:

  • Sprint-1/refactor/includes.test.js

were used to confirm that the refactored implementation still works correctly.


Testing

All tests were run locally using:

cd Sprint-1
npm test -- refactor

All tests passed successfully.


@Richiealx Richiealx added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 13, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant