Filter method THe functionality of filter method is that based on its function argument returns value
if the return value is true then it place in a new array else it does't
Place the item where condition returned true in a array
ex : var ar =[12,10,23,22,15,51,89,34];
var x= ar.filter(function(a){
if (a%2 ===0){
return true
}
else{
return false
}
}) console.log(x)