Skip to main content

Posts

How to Use else if in JavaScript with Examples

  How to Use else if in JavaScript with Examples The if and else-if statements are commonly used commands in the field of programming. Computer programmers learn if statements during their beginner-level courses, which makes this a very basic lesson for developers. The statement has a very similar use in JavaScript, Java and C, but we will be focusing on how to use if and else if in Javascript, in this article.    “If” is just the first conditional statement, which is followed by a series of conditions that help you make more complex decisions throughout the program. Once you have a stronghold over these conditional statements, you can start working your way through small programs.  Apart from “If” we have “else-if”, then we have “else-if else-if”, and then there’s nested-if as well. Below you can find each of these if statements explained with examples.  Using IF in JavaScript The if statement is always followed by a condition. Then it is further followed by a block of code whic

Building A Node.js Based CLI For Real-Time COVID-19 Vaccination Tracking

Why Build? As we already know the whole world is suffering from COVID-19 and the vaccinations are going in full swing everywhere. Finding a slot is getting tougher in our country India as we have a huge population to be vaccinated. Numerous times we have to go to CoWin site to search for a slot and slots are always full. It is pretty time-consuming and irritating. Being a developer, I thought most of the time is usually spent by us in the terminal so why can't we have a basic terminal-based app to save time. So this post will help you in two ways     Learn how to create Node.js based CLI's     Get real-time info about vaccination slots for your area. Let's begin our initial setup! Pre-requisite  – We are assuming you have installed Node.js and npm, If not you can install from  here So as a first step lets initialize our project using command npm init Enter the basic details as shown below. This will create package.json file in the folder cowinCLI. The next step is to cre