Which JavaScript method is used to create a new array with array elements that passes a test?

70. Which JavaScript method is used to create a new array with array elements that passes a test?

  1. forEach()
  2. map()
  3. forMap()
  4. filter()

Answer: D) filter()

Explanation:

The JavaScript method filter() is used to create a new array with array elements that pass a test.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.