Every useful information you need to know about Docker
Memoization is an optimisation technique base on remembering results returned by a function called with same arguments.
If we have a pure function that consume intensive computation, then we can use memoization.
The memoization will help us store the output value that has already been achieved and then the next time the function is called with the same input value it can simply return the stored value without going through all the computations.
Without memoisation computations are excessive, and time consumed for the following function is 4727 ms :
In few words: A closure is the ability of a function to access its outer scope.
In JavaScript, every time a function is created, a closure is associated to it. And thanks to closure, JavaScript inner functions has access to:
The function sayHello
has a closure the let it access the global scope variable myName
. Also, if myName
changes, sayHello
will print the new value that this global variable has taken.
To prove that our public NodeJS module is healthy, reliable, and secure, we must associate to it a version. And each time we make an update to that package we should also update this version.
This version update is done following a standard universal agreement called Semantic Versioning known also as SemVer. This standard is helpful for other developers who depend on our package to figure out if they need to make a change on their own code or not.
Semantic Versioning is implemented on the package.json file and it’s represented like this:
{
"name": "package-name",
"version": "2.13.4"
}
Patch…
Full Stack JavaScript Developer Experienced in NodeJS, Express, MongoDB, React, etc.