Chapter 6: functions

Task 3

Filter through function

We have a built-in method arr.fitler(f) if it returns true, then that element is returned in the resulting array.

Make a set of ready to use filters:

  • inBetween(a, b) - between a and b or equal to them (inclusively).
  • inArray([...]) - in the given array.