highFilter = high ⇒ x ⇒ x≥high
Hisinhan / Jan 11 2021
12 mins read • 8,000 views
Higher order function and closure.
let hightFilter = high ⇒ {
return function(x){
return x>=heigh
}
}
//equalvient
let highFilter= high ⇒ x ⇒ x ≥ high;
//usage
let array = [2,4,6,7,10]
let gt10 = highFilter(10)
console.log(array.filter(gt10))