Skip to content

Commit b9e1bd8

Browse files
author
Enice-Codes
committed
complete dead-code exercise
1 parent b31a586 commit b9e1bd8

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ let testName = "Jerry";
55
const greeting = "hello";
66

77
function sayHello(greeting, name) {
8-
const greetingStr = greeting + ", " + name + "!";
98
return `${greeting}, ${name}!`;
10-
console.log(greetingStr);
9+
1110
}
1211

1312
testName = "Aman";

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
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());
5+
66
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
77

8-
function logPets(petsArr) {
9-
petsArr.forEach((pet) => console.log(pet));
10-
}
8+
119

1210
function countAndCapitalisePets(petsArr) {
1311
const petCount = {};

0 commit comments

Comments
 (0)