HOF vocabulary

  • filter: "filters [array] and returns a new array where [condition]" — does NOT mutate
  • map: "transforms each [element] into [result], returning a new array of [type]"
  • reduce: "reduces to a single [type] by [accumulation logic], starting from [initial value]"
  • forEach: "invoked for each element; the callback receives [element] and [index]"
  • async: "asynchronously [verb]; awaits the result of; resolves with"

Question 0 of 5

Read this code: const activeUsers = users.filter(u => u.isActive);
Which description is correct?