🎉 Exercism Research is now launched. Help Exercism, help science and have some fun at research.exercism.io 🎉
Track JavaScript
JavaScript track

Strain

An exercise from the JavaScript track
medium

About this exercise

Implement the `keep` and `discard` operation on collections. Given a collection and a predicate on the collection's elements, `keep` returns a new collection containing those elements where the predicate is true, while `discard` returns a new collection containing those elements where the predicate is false.

algorithms
arrays
callbacks
filtering
lists
conditionals
loops
View all solutions