A promise is an object used as a placeholder for a value, which might be available as a result of asynchronous operations such as a response from an HTTP request.

When we make an asynchronous call, it immediately returns a promise object to register callbacks that will run when the…

Let's first discuss how variables declared, withvar and let are different.

Both let and var are used to declare variables, that can be optionally initialized at the time of declaration.

As per MDN:

The var statement declares a function-scoped or globally-scoped variable, optionally initializing it to a value.

The let

Nandan Pandey

Sr. JavaScript Developer at GlobalLogic, React, Nextjs, GraphQl, Serverless, JamStack

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