filer method()

 let a = [12,3,4,5,5];

let no = a.filter(function(num){

  return num>10;

})

console.log(no);

it is a filter function 


The filter() method creates an array filled with all array elements that pass a test (provided as a function).

Note: filter() does not execute the function for array elements without values.

Note: filter() does not change the original array.


Comments