HSET– It will set the field in the hash stored at key to value if field does not exist. If key does not exist, it will create one for you. If field already exist, it has no impact on the hash. HGET– It will return the value connected with field in the hash stored at […]
A common gotcha with Promise.all in JavaScript
What do you think will be result of this code below? Many people will assume that it will not run all the promises. That it will stop executing after the third index. But the fact is promise.all runs parallel so it will map through all the array. However, since one of them is rejecting, it […]
How to chain JS promises?
Many times we have promises which needs to be executed one by one and may have data dependency from the previous promise. For example, we want to write three promises where one provides current date, second one provides date in milliseconds and third one provides the formatted date in YYYY-MM-DD format. There can be more […]
How to setup aws-cli
You need to install the aws-cli in your system. You can click here to install the aws-cli for your desired operating system. To confirm, the successful installation, open your command line and execute the command below: In case you are unable to execute the command, please close and reopen the command line and try again. […]
How to use Promise.all() in JavaScript
Promise.all is iterable promise object which is a powerful promise API and allows us to perform asynchronous operations. Promise.all takes multiple promises as an array. Promise.all maintains the order in which promises are added into an promise array. Lets see it through an example. in example above, we can see that promises are executed one […]
5 Commonly used HTML Tags
Hyper Text Markup Language is the standard markup language for documents designed to be displayed in a web browser. You can create documents using multiple HTML tags. Let’s see some of the important HTML tags. Comment Tag ( <!— … –> ) : This tag is used for putting comments inside your file. Comments are […]
Playing with JavaScript Dates
JavaScript Date objects are not the easiest to work with. This is why many developers install different modules such as moment.js, or Luxon. Let’s say you would like to get the month, date and year from the provided Date object, you can fetch it as shown below. In JavaScript, getMonth() returns the month where January […]
Learn about JavaScript Dates
Many times, we find it hard to work with JavaScript Date, but it is still widely used. By default, JavaScript will use the browser’s time zone and displays that date. We can create Date object using the new Date() constructor. We can use this constructor by passing different values to it to generate the date […]
Setup Express in Node.js
Node.js is an open source server environment that allows us to use JavaScript. Express is a minimal and flexible Node.js web application framework to provide server side functionality for web and mobile applications. Let’s start by creating a folder where you want your express server to be running. Execute the following command in your command […]
Using axios in a React Project
You may need to interface with RESTful API for your project. Axios is a lightweight and promise based library to perform HTTP requests. Let’s start by adding axios to our react project In order to add axios to your project, go to command line. Change your directory to your project directory where you want to […]