Repository navigation
London | 26-ITP-Sep | Sakiya Mayow | Sprint 3 | Dead code - #1768
zakiaao-tech wants to merge 6 commits into
Conversation
dkrest1
left a comment
There was a problem hiding this comment.
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!
|
|
||
| function sayHello(greeting, name) { | ||
| const greetingStr = greeting + ", " + name + "!"; | ||
| return `${greeting}, ${name}!`; |
There was a problem hiding this comment.
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!
| const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"]; | ||
| const capitalisedPets = pets.map((pet) => pet.toUpperCase()); | ||
| const petsStartingWithH = pets.filter((pet) => pet[0] === "h"); | ||
|
|
There was a problem hiding this comment.
Good job identifying and removing the unused capitalisedPets variable and logPets() function! 👏
You've kept the relevant code focused on the task.
Learners, PR Template
Self checklist
Task code
CYF-1066.
Changelist
I made regular commits when removing unused code (dead code).