Skip to content

Cape Town | 26-ITP- Sept | Leigh Ross | Sprint 3 | Refactoring Dead Code - #1719

Open
leigh-ross wants to merge 9 commits into
CodeYourFuture:mainfrom
leigh-ross:coursework/sprint-3-dead-code
Open

leigh-ross wants to merge 9 commits into
CodeYourFuture:mainfrom
leigh-ross:coursework/sprint-3-dead-code

Conversation

@leigh-ross

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

Removed all dead code from exercise-1 and exercise-2.

@leigh-ross leigh-ross added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 16, 2026
Comment thread dead-code/exercise-1.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

for it to work on every name, you don't need to hard code Aman!

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.

Hi there, not sure what you are referring to.
I had removed the testName variable in favor of passing the name as a variable .
Please check my work again.

Comment thread dead-code/exercise-1.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

to uppercase is found both inside and outside the function, that's redudancy

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.

Again I am not sure what you are referring to because I have deleted the redundant code.
The lines that are highlighted in red are deleted lines. Lines highlighted in green are lines I have added.
You should be able to see that I removed line 5 where the redundancy was.

Please recheck my work.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apollogies, on the to uppercase I might have made a mistake,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"I had removed the testName variable in favor of passing the name as a variable ."

it is not a variable in your code, it has to be a variale, while you mantaining your goal of removing redudancy

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.

Okay I see. I have made the necessary changes.
Could you please explain why the testName variable is needed instead of passing the name directly into the function call?

@KudahShambare KudahShambare 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 Oct 21, 2026
@leigh-ross leigh-ross added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 27, 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. Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants