Functional Refactoring in JavaScript

I don’t pretend to be an expert in functional programming, but I hope you’ll find interesting to have the different steps and thoughts that have guided me during a refactoring following the functionals principles.