West-Midlands | 26-ITP-May | Maryam Janjua | Sprint 3 | Dead Code - #1605
West-Midlands | 26-ITP-May | Maryam Janjua | Sprint 3 | Dead Code#1605maryam-devio wants to merge 2 commits into
Conversation
|
Nice job removing the dead code instead of commenting it out that keeps the PR focused on the exercise. One thing to check though: you've removed the declaration of testName, but it's still being used later in the file. testName = "Aman";Since testName is no longer declared, this will cause an error. The goal is to remove only dead code while preserving the existing behaviour, so could you restore the declaration and only remove code that isn't used? |
|
Thank you for your feedback! You're absolutely right. My version wasn't running in strict mode, so I overlooked the missing declaration. I understand the importance of explicitly declaring variables with const and let for clarity and correctness. |
|
Well done. Your code is now error free and I will mark this as completed. |
Learners, PR Template
Self checklist
Changelist
Removed dead and redundant code while preserving the program's original behavior.