sample code image
sample code image
Photo by Christopher Robin Ebbinghaus on Unsplash

How often have we come across situations where your project has a lot of code that may have been used at an earlier stage to build a MVP and then years later it is just lying there because someone did not do a proper job of refactoring it?

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

Senior front end developer with expertise in Angular

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