Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 669 Bytes

File metadata and controls

30 lines (23 loc) · 669 Bytes
id filter
compare
filter
map
mainCompare filter
focusOn map
video 239108249
learnBackAbout fromEvent
lesson 6
title Map vs Filter - Project function vs Predicate
layout default
class post
preview_image filter/content_preview.jpg
preview_image_alt Filter a stream

Project vs Predicate

In the video example, ▬ isEven accepts a number as an argument:

  • If it is an even number, it returns ✔ true
  • Otherwise, it returns ✘ false

It is used as:

  • a project function on ❚ map
  • a predicate function on ❚ filter

A predicate returns ✔ true or ✘ false.

Learn more about project and predicate.