function makePredicateFunc(min, max){
return function(num){
return num >= min && num <= max;
}
}
const isChild = makePredicateFunc(0,17);
console.log(isChild);
// Output
ƒ (num) {
return num >= min && num <= max;
}
Why the output mentions min and max variable name instead of values 0 and 17 ?
min, max variable should have replaced with hard coded values
// Output should be like this f(num) { return num >= 0 && num <= 17; }