Skip to content

Commit 44c6d1d

Browse files
committed
Fix: Removed capitalisePets and logPets as they are not used in producing final output
1 parent 8c21873 commit 44c6d1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

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

67
function countAndCapitalisePets(petsArr) {
78
const petCount = {};
@@ -17,6 +18,6 @@ function countAndCapitalisePets(petsArr) {
1718
return petCount;
1819
}
1920

20-
const countedPets = countAndCapitalisePets(pets);
21+
const countedPetsStartingWithH = countAndCapitalisePets(petsStartingWithH);
2122

22-
console.log(countedPets); // { 'PARROT': 1, 'HAMSTER': 3, 'HORSE': 1, 'DOG': 1, 'CAT': 1 }
23+
console.log(countedPetsStartingWithH); // { 'HAMSTER': 3, 'HORSE': 1 } <- Final console log

0 commit comments

Comments
 (0)