Mark As Completed Discussion

Build your intuition. Click the correct answer from the options.

What does Array.prototype.filter() do?

A. It loops over an array, calling a specified callback function at each iteration.

B. It generates a new array by invoking the callback function given as a parameter for each input array element.

C. It generates a shallow duplicate of a piece of an array, filtered to include only the array elements that satisfy the provided function's test.

D. None of the above.

Click the option that best answers the question.

  • A
  • B
  • C
  • D