DEV Community

Discussion on: Is functional programming in JS really worth it?

Collapse
 
joshuakb2 profile image
Joshua Baker

Every code snippet in this article is functional. The only difference between your imperative and your functional examples is that the functional examples are convoluted.

isEven and isOdd are honestly such small tasks that it's hard to implement them in an imperative way. After all, imperative programming is about having a sequence of statements that have side effects, such as mutating variables.