Don’t Fear the Monad
By adopting two simple principles in your code today, you can reap 90% of the benefits of FP without ever having to learn what a Monad or a Functor is.
A pure function by virtue always returns the same output given the same input. The big takeaway here is not to use global state! Your functions need not rely on their outside environment.
What this means is that if you are using global variables, you are doing it wrong. The litmus test is whether you can remove the file from your code and run it in another application with minimal setup. In my React projects, all of my UI components are organized in their own modules. Each can be published to NPM on its own and often after I finish a project, I will go back and remove the best components. I put them aside for a later use.
The reason I am able to acheive such a high level of modularity is because I impose a few simple rules, which keep my modules decoupled and infinitely composable.
Immutable Data Structures
I suppose by virtue, I am breaking the rule here by giving you complex terminology. What I will tell you is that without fully understanding the implementation details of immutable data structures, you can implement them into your workflow. There are libraries, such as ImmutableJS that bridge the gap.
I will tell you the best way to start using Immutable data structures today is just to get in the habit of not mutating your data! With ES6, using const is often the go to approach. In many ways, by using the const keyword, you will get into the habit of not reassigning your variables. Although a const is not immutable, being that you can mutate the properties of an object defined with const, using it will help you to get used to the idea of how to work with immutability.
Summing it up
Everyone can benefit from the lessons of Functional Programming. We live in a very exciting time, being able to see cutting edge techniques make their way from academia to the mainstream. By making two small changes to your programming style, you can reap many of the benefits of Functional Programming, without having to learn all of the terminology. Keep your functions pure and your data immutable.
There is no shortage of purely functional languages and resources to learn them. You can pick up Haskell, Elixir, Scala or Clojure through a multitude of resources available for free online.