DEV Community

loading...

Discussion on: No love for boolean parameters

Collapse
tkdodo profile image
Dominik D Author • Edited

yes, passing the function is what is described in the inversion of control article I linked to. Definitely worth a read, a very nice concept.

Collapse
darkwiiplayer profile image
DarkWiiPlayer • Edited

Calling it "inversion of control" almost seems a bit weird to me because it implies that it is the "inverted" form of how it should normally be. But the example of a select (or filter or whatever one wants to call it) function makes it very obvious how it's really just another way to write a loop. It's not "inverted"; it's just normal control-flow.