DEV Community


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

jejones3141 profile image
James Jones

What is "imperative" about those first two functions? They don't modify their arguments or count on some global state. They'll always return the same value given the same input.

ispoljari profile image
Ivan Spoljaric Author • Edited

Yeah, I agree with you. But the characteristics you defined make them pure. And just because they are pure it doesn't mean that they are automatically written in a declarative style.

In the purist FP way, as I understand it, functions should be written in point-free style to achieve the "declarative" data flow.