Functional JavaScript

Functional programming in JavaScript has been a topic of considerable discussion for some time now. Several books have been published about functional programming in JavaScript and there are developers that use this approach almost exclusively.

Whether or not JavaScript is a functional programming language is beside the point now because so many people are using it for such.

I don’t know enough about functional programming to teach the ins and outs of that particular approach. However, what I do know is that functional programming has some very valuable concepts that you can draw on to improve your code. I’m advocating a pragmatic approach to functional programming in JavaScript. In other words, use elements of functional programming that you find valuable.

So this begs the question, how to get started? Well, as mentioned there are several books published about the subject, and I will be reviewing some of those in the future. But I think a great first step is to really understand some of the methods of the Array object. These methods were designed around functional programming concepts. For example, map, forEach, every and reduce are a few that are valuable to understand. And it just so happens we have a tutorial on some of those methods.

What are your thoughts on functional programming in JavaScript?

You can find the tutorial here:

Author: Steven Hancock

Steven has 20+ years experience in product development and 15+ years using JavaScript. He started learning JavaScript when it was a niche language used for minor affects on a web site. The growth and ubiquitous nature of JavaScript both excites and inspires him. Currently he is President and lead Trainer at All Things JavaScript, a resource for anyone and everyone that hopes to increase their JavaScript skills. Steven was the co-owner of Rapid Intake, an eLearning Authoring firm. While there he managed all development and professional service related activities. He was heavily involved in the initial development of Rapid Intake's main product, which eventual lead to its acquisition in 2011. In addition to JavaScript, Steve has also dabbled in other web technolgies such as ActionScript, ASP, PHP, HTML, and CSS.