Master the JavaScript Interview: What is a Closure?
Eric Elliott
5.3K48

Are dynamic filter predicates a good candidate for closures?


function toFilter(oldParams, newParams, cache) {
return function forUpdate(target) {
return target.isStale(oldParams, newParams) ||
!target.isCached(cache)
}
}
Like what you read? Give Tim Davis a round of applause.

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