What Does ... (Three Dots) Mean In JavaScript

In this tutorial, you’ll learn what … ( three dots ) mean in JavaScript. Three Dots (…) which are know as Spread or Rest operator in JavaScript were introduced as an ES6 feature. Let’s first try to understand how three dots work as Spread operator in JavaScript. Spread Operator In JavaScript As the word Spread suggests the three dots (…) can be used to spread the contents on an array. [Read More]

Debug Node Express Project From Visual Studio Code

In this tutorial, you’ll learn a quick tip on how to debug Node Express project from visual studio code. Let’s start by creating a simple Express web app. Create a folder called basicExpress. Navigate to the folder and initialize the Node project. mkdir basicExpresscd basicExpressnpm initOnce you have the project created, create a file called app.js. You’ll be using express framework, so install express using npm. # install express using npmnpm install express --saveAdd the following code to app. [Read More]

How to Implement Dark Background Mode in CSS

Image Source The dark mode is becoming a built-in option in every big operating system. Windows 10 and macOS have already adopted dark mode, and it’s coming to iOS 13 and Android. Chrome and Firefox have their own dark modes. Despite the hype, dark mode won’t necessarily help reduce eye strain. The dark mode isn’t a one-size-fits-all improvement for everyone. That’s why it’s an option that’s not enabled by default. [Read More]

JavaScript Program To Find Factorial Of A Number

In this tutorial, you’ll learn how to write a program to find factorial of a number. This post is a part of the JavaScript coding practice series. Factorial Of A Number First, let’s try to understand what the factorial means before trying to implement it. The factorial of a number n means, the product of all positive integers less than or equal to n. For example, the factorial of 4 is 4*3*2*1 = 24. [Read More]

JavaScript, Array Contains

How to check if Array Contains or Includes a value or string using JavaScript? You’ll be making use of Array.prototype.indexOf and Array.prototype.includes method to check if an array contains a value. Using IndexOf Method indexOf method gives you the element index inside an Array. So, if the element exists inside the array the index returned will be greater than -1. Here is how you use indexOf to check if a value is found in an array. [Read More]

Flexbox in CSS

Learning Flexbox in CSS.

In this video tutorial, I have tried to cover the basic of flexbox layout in CSS. If you a beginner trying to understand the flexbox layout, this video will help you get started.

How To Check If Object Has Key In JavaScript

In this tutorial, you’ll learn how to check if an object has key in JavaScript. You’ll be making use of in operator for checking if a key is present or not.

let obj = {
    'name' : 'Roy'
}

if('name' in obj){
    console.log('Found')
} else {
    console.log('Not found')
}

How To Check If Object Is Array In JavaScript

In this tutorial, you’ll learn how to check if an Object is an array in JavaScript. For checking if an array, JavaScript provides a built in method called isArray.

let arr = [];
    
if(Array.isArray(arr)){
    console.log('It is an array!!')
} else {
    console.log('Not an array!!')
}

How to Fetch Data From API Server Side | Next.js | getServerSideProps

How to Make an API call from server side in Next.js using getServerSideProps

In this tutorial, you’ll see how you can make an API call from server side using getServerSideProps. Using getServerSideProps you can make an API call in the Next.js page during server side rendering.

How To Handle Promise Inside Loop

In this tutorial, you’ll learn how to handle JavaScript promise inside loop. Promises are an important concept in JavaScript programming. Getting a basic understanding about how Promises work in JavaScript is a must for every JavaScript developer. Assuming you have an understanding about how promises work, you will be able to understand this tutorial. Promise Inside For/ForEach Loop Create a folder called promise_loop. Initialize the project folder using npm. mkdir promise_loopcd promise_loopnpm initCreate a file called helper. [Read More]