Skip to content

Commit 1bdaae2

Browse files
committed
remove dead code, show example usage of general purpose function
1 parent 84ebbef commit 1bdaae2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Sprint-1/destructuring/exercise-2/exercise.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,15 @@ function getPersonByPredicate(list, predicate) {
100100
});
101101
}
102102

103+
/*
104+
Example usable of the above general purpose version which allows the user to filter by different
105+
properties.
106+
103107
getPersonByPredicate(hogwarts, (person) => person.house === "Gryffindor");
104108
105109
getPersonByPredicate(
106110
hogwarts,
107111
(person) => person.occupation === "Teacher" && person.pet
108112
);
113+
114+
*/

0 commit comments

Comments
 (0)