functional programming javascript code example
Example: what is functional programming
By respecting these restrictions,
FP aims to write code that is clearer to understand and more bug resistant.
This is achieved by avoiding using flow-control statements
(for, while, break, continue, goto) which make the code harder to follow.
requires us to
write pure, deterministic
functions which are less likely to be buggy.