Skip to content

Commit 8f64420

Browse files
committed
removed the redundant line of codes and the unused functions
1 parent feb8f90 commit 8f64420

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
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());
6+
// -- Removing this because countAndCapitalisePets already capitalises each pet. --redundant code
67
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
78

8-
function logPets(petsArr) {
9-
petsArr.forEach((pet) => console.log(pet));
10-
}
9+
// function logPets(petsArr) {
10+
// petsArr.forEach((pet) => console.log(pet));
11+
// }
12+
13+
// --logPets does not effect the final console.log - unused code
1114

1215
function countAndCapitalisePets(petsArr) {
1316
const petCount = {};

0 commit comments

Comments
 (0)