Skip to content

Commit 7ae80a5

Browse files
committed
restored files not ment to be changed
1 parent e6c3c69 commit 7ae80a5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
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";
45
const greeting = "hello";
6+
57
function sayHello(greeting, name) {
8+
const greetingStr = greeting + ", " + name + "!";
69
return `${greeting}, ${name}!`;
10+
console.log(greetingStr);
711
}
12+
813
testName = "Aman";
14+
915
const greetingMessage = sayHello(greeting, testName);
1016

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

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

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

8+
function logPets(petsArr) {
9+
petsArr.forEach((pet) => console.log(pet));
10+
}
11+
712
function countAndCapitalisePets(petsArr) {
813
const petCount = {};
914

0 commit comments

Comments
 (0)