Skip to content

Commit b2e5292

Browse files
committed
fixed dead code in exercise 1 and 2
1 parent ff49d6c commit b2e5292

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
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";
5-
const greeting = "hello";
6-
74
function sayHello(greeting, name) {
85
const greetingStr = greeting + ", " + name + "!";
96
return `${greeting}, ${name}!`;
10-
console.log(greetingStr);
117
}
12-
13-
testName = "Aman";
14-
15-
const greetingMessage = sayHello(greeting, testName);
8+
const greetingMessage = sayHello('hello', 'Aman!');
169

1710
console.log(greetingMessage); // 'hello, Aman!'

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// The countAndCapitalisePets function should continue to work for any reasonable input it's given, and you shouldn't modify the pets variable.
33

44
const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"];
5-
const capitalisedPets = pets.map((pet) => pet.toUpperCase());
65
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
76

87
function logPets(petsArr) {

0 commit comments

Comments
 (0)