DEV Community

Discussion on: Flow control, short-circuit expressions and functional programming in JavaScript

 
daslaf profile image
Osman Cea

Looks like a regular reducer to me... how is this related to what we were talking?

Thread Thread
 
pengeszikra profile image
Peter Vivo

reducer is looks same as ternary with two function, just case use one condition with many pure function.

Thread Thread
 
daslaf profile image
Osman Cea

Again, this is because you care about the result of the function. My take is: use statements for side effects and expressions for pure functions.