Skip to content

Commit 4e98905

Browse files
committed
removed some lines of code as they felt like they were not needed.
1 parent b41f635 commit 4e98905

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

‎dead-code/exercise-2.js‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,6 @@
11
// Remove the unused code that does not contribute to the final console log
22
// The countAndCapitalisePets function should continue to work for any reasonable input it's given, and you shouldn't modify the pets variable.
33

4-
// const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"];
5-
// const capitalisedPets = pets.map((pet) => pet.toUpperCase());
6-
// const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
7-
8-
// function logPets(petsArr) {
9-
// petsArr.forEach((pet) => console.log(pet));
10-
// }
11-
12-
// function countAndCapitalisePets(petsArr) {
13-
// const petCount = {};
14-
15-
// petsArr.forEach((pet) => {
16-
// const capitalisedPet = pet.toUpperCase();
17-
// if (petCount[capitalisedPet]) {
18-
// petCount[capitalisedPet] += 1;
19-
// } else {
20-
// petCount[capitalisedPet] = 1;
21-
// }
22-
// });
23-
// return petCount;
24-
// }
25-
26-
// const countedPetsStartingWithH = countAndCapitalisePets(petsStartingWithH);
27-
28-
// console.log(countedPetsStartingWithH); // { 'HAMSTER': 3, 'HORSE': 1 } <- Final console log
29-
304
const pets = ["parrot", "hamster", "horse", "dog", "hamster", "cat", "hamster"];
315
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
326

0 commit comments

Comments
 (0)