The Precision Filter

Easy+15 XP

Mission Briefing

The security system is overflowing with false alarms! We need to apply a strict filter so that only priority level threats make it through to the dashboard.

The Concept: Array Filtering

The .filter() method creates a new array filled only with elements that pass a test (returning true) provided by a function. Example: [10, 5, 20].filter(x => x > 10); // Returns [20]

The Objective

Your function receives an array nums.

  1. Use the .filter() method.
  2. Return a new array containing only the numbers that are strictly greater than 10.

01EXAMPLE 1

Inputnums = [5, 12, 8, 130]
Output[12, 130]

Constraints

  • Use the .filter() method.
CoreArraysMethods
JavaScript
Loading...
3 Hidden

Input Arguments

nums[5,12,8,130,44]

Expected Output

[12,130,44]

Click RUN to test your solution