Every useful information you need to know about Docker

What is Docker?

  • Docker is the software used to build, run, and orchestrate containerized applications.


What is Memoization?

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.

Memoize Fibonacci

Without memoisation computations are excessive, and time consumed for the following function is 4727 ms :


What is a closure?

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:

  • Outer function’s variables

The function sayHellohas a closure the let it access the global scope variable myName. Also, if myName changes, sayHellowill print the new value that this global variable has taken.

Most Funny Part of Closures


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:

Semantic Versioning
{
"name": "package-name",
"version": "2.13.4"
}

Patch…

Taha El Bouffi

Full Stack JavaScript Developer Experienced in NodeJS, Express, MongoDB, React, etc.

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