DEV Community

Cover image for Memoization in JavaScript
Shoaib ur Rehman
Shoaib ur Rehman

Posted on

Memoization in JavaScript

Memoization is one of the crucial features of JavaScript. It improves the efficiency of your program and reduces CPU usage. It is used to store the result of a CPU-intensive operation. For example, if an operation takes 1ms of CPU. If we already have the result of the operation, we don't need to operation again and again.Accessing the result takes less time instead of calculating the operation again. e, g 0.5ms. We just saved 0.5ms of CPU time.

Top comments (0)