Skip to content

Commit 5b86cbe

Browse files
committed
remove dead code from exercise 2
1 parent 3641b92 commit 5b86cbe

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

‎dead-code/exercise-2.js‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
// Remove the unused code that does not contribute to the final console log
2-
// The countAndCapitalisePets function should continue to work for any reasonable input it's given, and you shouldn't modify the pets variable.
3-
41
const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"];
5-
const capitalisedPets = pets.map((pet) => pet.toUpperCase());
62
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
73

8-
function logPets(petsArr) {
9-
petsArr.forEach((pet) => console.log(pet));
10-
}
11-
124
function countAndCapitalisePets(petsArr) {
135
const petCount = {};
146

@@ -25,4 +17,4 @@ function countAndCapitalisePets(petsArr) {
2517

2618
const countedPetsStartingWithH = countAndCapitalisePets(petsStartingWithH);
2719

28-
console.log(countedPetsStartingWithH); // { 'HAMSTER': 3, 'HORSE': 1 } <- Final console log
20+
console.log(countedPetsStartingWithH);

0 commit comments

Comments
 (0)