There’s a lot to love about functional programming. While this isn’t the place to layout the benefits or tradeoffs of the functional programming style, its safe to say that the concepts can bring a lot of order, power, and simplicity to your code. However, in all of that, it’s also easy to get lost in the weeds of terminology and mathematical jargon. My goal in this post is to take a shallow dive into the world of functional programming, currying, and point-free functions in JavaScript and explain one use case where functional programming improves the readability of a simple function.
I was working on a JavaScript function this week that takes a timestamp and converts it to a date object in order to compare different dates. The original function looked like this:
/**