Skip to content

Commit 712b964

Browse files
fixed-dead-code
1 parent 197be89 commit 712b964

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +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 capitalisedPets = pets.map((pet) => pet.toUpperCase());
5+
//const capitalisedPets = pets.map((pet) => pet.toUpperCase());
66
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
77

88
function logPets(petsArr) {
@@ -14,8 +14,8 @@ function countAndCapitalisePets(petsArr) {
1414

1515
petsArr.forEach((pet) => {
1616
const capitalisedPet = pet.toUpperCase();
17-
// if (petCount[capitalisedPet]) {
18-
// petCount[capitalisedPet] += 1;
17+
if (petCount[capitalisedPet]) {
18+
petCount[capitalisedPet] += 1;
1919
} else {
2020
petCount[capitalisedPet] = 1;
2121
}

0 commit comments

Comments
 (0)