Skip to content

London | 26-ITP-Sep | Sakiya Mayow | Sprint 3 | Dead code - #1768

Open
zakiaao-tech wants to merge 6 commits into
CodeYourFuture:mainfrom
zakiaao-tech:coursework/sprint-3-dead-code
Open

zakiaao-tech wants to merge 6 commits into
CodeYourFuture:mainfrom
zakiaao-tech:coursework/sprint-3-dead-code

Conversation

@zakiaao-tech

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-1066.

Changelist

I made regular commits when removing unused code (dead code).

@zakiaao-tech zakiaao-tech added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 1, 2026
@dkrest1
dkrest1 requested a review from Poonam-raj November 4, 2026 02:36
@dkrest1 dkrest1 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 4, 2026

@dkrest1 dkrest1 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.

Great work Sakiya! 👏

You've successfully identified and removed redundant and unreachable code while preserving the intended functionality.

I particularly liked how you simplified the variable declarations and removed unused functions without introducing unnecessary changes.

Well done, and keep up the good work!

Comment thread dead-code/exercise-1.js

function sayHello(greeting, name) {
const greetingStr = greeting + ", " + name + "!";
return `${greeting}, ${name}!`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice work cleaning up the code 👏

You've correctly removed the redundant variable and unreachable statement while keeping the sayHello() function working as expected.

One quick question to reinforce your understanding: why was the original console.log(greetingStr) unreachable?

Great progress overall!

Comment thread dead-code/exercise-2.js
const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"];
const capitalisedPets = pets.map((pet) => pet.toUpperCase());
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");

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 job identifying and removing the unused capitalisedPets variable and logPets() function! 👏

You've kept the relevant code focused on the task.

@dkrest1 dkrest1 added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Nov 4, 2026
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 all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants