This post will tell you the basics and benefits of functional programming and how to use them in JavaScript.Functional programming is a way of writing software with specific principles. The idea is that these principles willImprove developer productivityFunctions should be pure. Pure functions always produce the same output and have no side effects affecting the output. Side effects are anything that's outside the control of the function. e.g.
JavaScript is not a purely functional programming language. So there's nothing from stopping you doing whatever you feel comfortable with though. , on the other hand, is an example of a purely functional programming language. In Haskell, you're forced to use functional programming principles.An immutable state means that the state should not change. Instead of changing the state, in functional programming we. This might seem counter-intuitive: why would we want to copy the state instead of changing it?// Create a person with a name let simon={"name": "simon"}; // Instead of copying simon, we assign it by reference.