Higher Order Functions (Composing Software)
Eric Elliott
1.95K15

const highpass = (cutoff) => {
return (n) => {
return n >= cutoff;
}
}

And just to make it sightly clearer, this works because the function returned forms a closure over the cutoff variable. ES2015 is quite terse when it wants to be.

Like what you read? Give Jason Boxman a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.