Skip to content

Commit 69ec0e4

Browse files
committed
Added code to filter pets starting with H
1 parent 47e2e67 commit 69ec0e4

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +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-
6-
7-
8-
5+
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");
96

107
function countAndCapitalisePets(petsArr) {
118
const petCount = {};

0 commit comments

Comments
 (0)