Repository navigation
London | 26-Sep-ITP | Frumentius Tesfay | Sprint 3 | Coursework/sprint 3 dead code - #1772
Frumentius-Rev wants to merge 7 commits into
Conversation
|
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. |
|
Thank you for your clear feedback. I have removed it as suggested. |
iscmiguelsamaniego
left a comment
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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!
- What happens in JavaScript when you use
letto declaretestNametwice in the same scope? - Inside
sayHello, what happens to any code placed after thereturnstatement, and isgreetingStrused anywhere else in that function?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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?
Learners, PR Template
Self checklist
Task code
CYF-1066
Changelist
Removed redundant, unused, and unreachable code from Exercises 1 and 2 while preserving the existing functionality.