When do closures have parameters (or how do closures with parameters work)? I know that use() is used to import variables outside the anonymous function, but what about the parameter(s) of the closure itself?
When do closures have parameters (or how do closures with parameters work)? I know
Share
An example of closures with parameters is currying:
The
greeterfunction will return a “half-implemented” function that will always start with the same greeting, followed by whatever is passed into it (e.g. the person to greet).