Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 716 Bytes

hof-filter.md

File metadata and controls

47 lines (31 loc) · 716 Bytes

Higher Order Functions - Filter


Objectives

  • Review Higher Order Functions
  • Review Map Method
  • Explain what the Filter method does
  • Solve Problems Using Filter

Higher Order Function


##takes a function as an input ###OR

returns a function as output


Map


Map Review

  • An array method
  • Takes a function as an input
  • Applies that function to every item in the array
  • Returns a NEW array that contains transformed data

Filter


Filter

  • An array method
  • Takes a function as an input (the function should return a boolean)
  • Tests each item in the array using the function
  • Returns a NEW array that contains all items that pass the test

Let's Try It