Skip to content

Commit d7e0367

Browse files
redundant code completely removed after review
1 parent a73b69e commit d7e0367

2 files changed

Lines changed: 0 additions & 8 deletions

File tree

Sprint-3/3-dead-code/exercise-1.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// Find the instances of unreachable and redundant code - remove them!
22
// The sayHello function should continue to work for any reasonable input it's given.
3-
4-
//let testName = "Jerry";
53
const greeting = "hello";
64
function sayHello(greeting, name) {
7-
// const greetingStr = greeting + ", " + name + "!";
85
return `${greeting}, ${name}!`;
96
}
107
testName = "Aman";

Sprint-3/3-dead-code/exercise-2.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
// Remove the unused code that does not contribute to the final console log
22
// The countAndCapitalisePets function should continue to work for any reasonable input it's given, and you shouldn't modify the pets variable.
33
const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"];
4-
//const capitalisedPets = pets.map((pet) => pet.toUpperCase());
54
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
65

7-
//function logPets(petsArr) {
8-
// petsArr.forEach((pet) => console.log(pet));
9-
//}
10-
116
function countAndCapitalisePets(petsArr) {
127
const petCount = {};
138

0 commit comments

Comments
 (0)