Skip to content

Commit 61780cb

Browse files
committed
dead-code completed
1 parent 29ef74a commit 61780cb

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

‎dead-code/exercise-1.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ const greeting = "hello";
66

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

1312
testName = "Aman";

‎dead-code/exercise-2.js‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
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

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

0 commit comments

Comments
 (0)