From ed608a140910e30041c00b0413485f9ec8fb01ea Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Thu, 4 Dec 2025 17:28:23 +0000 Subject: [PATCH 1/2] Add a little more guidance to dead code exercise Taken to the extreme, someone could e.g. just replace the code with `console.log("HAMSTER: 3, HORSE: 1")`. --- Sprint-3/dead-code/exercise-1.js | 1 + Sprint-3/dead-code/exercise-2.js | 1 + 2 files changed, 2 insertions(+) diff --git a/Sprint-3/dead-code/exercise-1.js b/Sprint-3/dead-code/exercise-1.js index 6077b36f..4d09f15f 100644 --- a/Sprint-3/dead-code/exercise-1.js +++ b/Sprint-3/dead-code/exercise-1.js @@ -1,4 +1,5 @@ // Find the instances of unreachable and redundant code - remove them! +// The sayHello function should continue to work for any reasonable input it's given. let testName = "Jerry"; const greeting = "hello"; diff --git a/Sprint-3/dead-code/exercise-2.js b/Sprint-3/dead-code/exercise-2.js index df0e3b45..56d7887c 100644 --- a/Sprint-3/dead-code/exercise-2.js +++ b/Sprint-3/dead-code/exercise-2.js @@ -1,4 +1,5 @@ // Remove the unused code that does not contribute to the final console log +// The countAndCapitalisePets function should continue to work for any reasonable input it's given, and you shouldn't modify the pets variable. const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"]; const capitalisedPets = pets.map((pet) => pet.toUpperCase()); From a4080d539adb819053057a8bb5fe0a31eacc312f Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Fri, 5 Dec 2025 14:06:01 +0000 Subject: [PATCH 2/2] Split up long sentence --- Sprint-3/dead-code/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/dead-code/README.md b/Sprint-3/dead-code/README.md index 785101d3..2bfbfff8 100644 --- a/Sprint-3/dead-code/README.md +++ b/Sprint-3/dead-code/README.md @@ -1,6 +1,6 @@ # Refactoring Dead Code -Here are two example of code that has not been built efficiently. Both files have dead code in them, it's your job to go back through this existing code, identify the dead code, and remove it so the code is ready for production. +Here are two example of code that has not been built efficiently. Both files have dead code in them. It's your job to go back through this existing code, identify the dead code, and remove it so the code is ready for production. ## Instructions