The goal of this post is to explain how to implement closures and memoization in JavaScript. I learn better when I code and if you’re like me, then you will surely enjoy this article.

Sample JavaScript image
Sample JavaScript image
Photo by Irvan Smith on Unsplash

Now before we jump into the topic, let us summarize what we know of functional programming — what are closures, and what do we actually mean when we use the term memoization?

Functional programming

Functional programming is a declarative type of programming style. It is a programming paradigm in which we try to bind everything in pure mathematical functions style. …

Akash Kriplani

Front end developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store