Skip to content

Commit 62a32bd

Browse files
committed
fixed dead code
1 parent d6a54b8 commit 62a32bd

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
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.
33

4-
let testName = "Jerry";
54
const greeting = "hello";
65

76
function sayHello(greeting, name) {
@@ -10,7 +9,7 @@ function sayHello(greeting, name) {
109
console.log(greetingStr);
1110
}
1211

13-
testName = "Aman";
12+
const testName = "Aman";
1413

1514
const greetingMessage = sayHello(greeting, testName);
1615

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"];
55
const capitalisedPets = pets.map((pet) => pet.toUpperCase());
66
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
77

8-
function logPets(petsArr) {
9-
petsArr.forEach((pet) => console.log(pet));
10-
}
11-
128
function countAndCapitalisePets(petsArr) {
139
const petCount = {};
1410

0 commit comments

Comments
 (0)