DEV Community

Discussion on: Functional Programming: Alternatives to the IF #Functional #JavaScript #Functors

Collapse
 
vlatri profile image
Vlad Trishch

I tend to use function I call safe:
const safe = f => x => x && f(x)
for these purposes. I just wrap all my functions that don't expect null/undefined into it.