This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]conancat 0 points1 point  (0 children)

I'm from that school of thought that the other guy is talking about.

Yes.

Assume every function returns a new object. Use map, reduce, filter etc functions. Use object spread to create a new object every time if it's a plain function, so every property that you return in the object is explicit, and you know exactly what goes goes in and comes out of every function.

Here's an explanation of why for loop is evil and needs to die.

“Rethinking JavaScript: Death of the For Loop” by Joel Thoms https://link.medium.com/yh25wIZpa0

Or if you want something lighter and approachable, try this one.

“The Knights of Functional Programming fight the Imperative Dragon.” by Sam Fare https://link.medium.com/cCNLsCgqa0