Skip to content

London | 26-Sep-ITP | Frumentius Tesfay | Sprint 3 | Coursework/sprint 3 dead code - #1772

Open
Frumentius-Rev wants to merge 7 commits into
CodeYourFuture:mainfrom
Frumentius-Rev:coursework/sprint-3-dead-code
Open

Frumentius-Rev wants to merge 7 commits into
CodeYourFuture:mainfrom
Frumentius-Rev:coursework/sprint-3-dead-code

Conversation

@Frumentius-Rev

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 redundant, unused, and unreachable code from Exercises 1 and 2 while preserving the existing functionality.

@Frumentius-Rev Frumentius-Rev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 12, 2026
@valentina-starr1

Copy link
Copy Markdown

Thank you for this PR. Great job cleaning up the dead code in Exercises 1 and 2.

Just one tiny optional cleanup in dead-code/exercise-1.js: testName is initialized to "Jerry" before immediately being reassigned to "Aman", so you can remove the "Jerry" initialization (e.g., just declare const testName = "Aman";).

Otherwise, looks great and ready to go for approval.

@Frumentius-Rev

Copy link
Copy Markdown
Author

Thank you for your clear feedback. I have removed it as suggested.

@Frumentius-Rev Frumentius-Rev left a comment

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.

New update.

@iscmiguelsamaniego iscmiguelsamaniego 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 job across backend, frontend, and tests today! Always remove unreachable code (like hardcoded returns), manage async errors, avoid duplicate declarations, and write robust tests. Being far from home is tough, but your progress is amazing. Keep pushing forward!

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.

Being far from home is tough, but every line of code you write is a step closer to building the future you deserve—keep going!

  1. What happens in JavaScript when you use let to declare testName twice in the same scope?
  2. Inside sayHello, what happens to any code placed after the return statement, and is greetingStr used anywhere else in that function?

Comment thread dead-code/exercise-2.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 help refine it:

Did you notice any duplicate declarations for petsStartingWithH in the code?

Are capitalisedPets and logPets used anywhere to achieve the final countedPetsStartingWithH output?

Being far from home is tough, but your persistence and focus are building a brilliant path forward—keep pushing!

Comment thread practice-tdd/count.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.

Thank you so much for sharing your code—it's wonderful to see the loop and counter logic set up so cleanly!

If we look closely at the very beginning of the function, what do you think happens when execution encounters return 5 right away? How might that affect test cases, like an empty string, that expect a count of 0?

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.

3 participants