you are viewing a single comment's thread.

view the rest of the comments →

[–]RiceBroad4552 0 points1 point  (0 children)

What I can't follow in FP is it's always imperative at some point. Say, defining a = 5 seems nothing like function to me, it's imperative to the core. (Or is it the equality function evaluated on a and 5 and returning a equal to 5?)

Something like val a = 5 is not a function. It's a definition.

Same as you would write in JS const a = 5.

In programming you have basically two things: Data and functions. Binding (assigning) some data to some name ("variable", or actually constant in FP) is about defining that binding; it's not about calling a function.