Generate HTML Markup in JavaScript With Pure Functional Programming

This post is a follow up to my previous post, An Introduction to Functional Programming in JavaScript. The aim of this post is to use the functional patterns introduced in my previous post to generate markup for a list of HTML select options and to highlight how a functional approach can lead to both cleaner and more reusable code. As a lot of the concepts used this post are explained in detail in the previous post, I will not be repeating them here so if anything doesn’t make sense, I would recommend referring to that post.
Continue reading


An Introduction to Functional Programming in JavaScript

A couple of months ago I decided to start learning Haskell as I was interested in seeing what functional programming was all about and how I could embrace it improve my all round programming skills. What quickly became apparent to me with functional programming is that there is a mathematical beauty and purity to it and this, for me at least, results in writing cleaner, more readable code. As I got more into the subject of functional programming I began to think how I could implement functional patterns in a website I am currently developing which has a large client-side data processing functionality and it turns out, after a little digging, that JavaScript is well suited to implementing these functional patterns.
Continue reading