Ramdajs in Nodejs for functional programming : Part 1


Ramda helps you bring functional programming (FP) paradigm to your JavaScript code. It makes use of the rich FP practices of Higher-order functions, currying, composition and others.

In the upcoming videos on my channel at Nodejs-Everyday I will show you all of these code snippets hands-on along with a series on Functional Programming with JavaScript.

We will have a look at few of the functions that we can use in our everyday code to kick-start using Ramda.js.

When we talk about functional programming, one of the 1st feature from FP that almost all talk about is MAP.

Map function takes in a functor and applies them on each of the element from the array/ object that we work with.

Here is the example of Map function.

If we have to do the same in ES5 using loops, we write it like this
What if we want to filter the students who class is 'CS'? We use the same loop from above and do a conditional check like below.
we can achieve the same using Ramda, the functional style with chaining the functions as below.

We will take a break here and examine the features in the next article. We will talk about Flatten, finding duplicates, merge and others