javascript

javascript

How to convert date to number in JavaScript

JavaScript program to convert date to number. Date class provides a method called getTime and we can use this method to convert a date to a number.

Read
javascript

How to check if a date is older than one month or 30 days in JavaScript

How to check if a date is older than one month or 30 days in JavaScript. We can use the getTime method to find the time and compare two date objects.

Read
javascript

JavaScript set add() method explanation with example

JavaScript set add() method is used to add or append a new element to the end of a set. This post will show you how to use add() method with examples.

Read
javascript

JavaScript program to delete an item from a set

JavaScript program to delete an item from a set. Learn how to delete a single value, multiple values and an object from a set in JavaScript.

Read
javascript

JavaScript program to check if an array is a subarray of another array

Check if an array is a subarray of another array or not in JavaScript. We will learn 3 different ways to check for a subarray.

Read
javascript

JavaScript Array every method explanation with example

JavaScript array every method is used to check if every element of an array satisfy a given callback function. Learn how to use array every method with examples.

Read
javascript

JavaScript example to add padding to the end of a string using padEnd

Learn how to add padding to the end of a string in JavaScript. We will use padEnd method to add padding to the string end.

Read
javascript

How to add one second delay in JavaScript

JavaScript program to add one second delay. We will learn how to do it by using a setTimeout, using a promise, using arrow function and by using async-await.

Read
javascript

JavaScript Map forEach method example

JavaScript Map forEach method explanation with example. Map is used to hold key-value pairs. Using forEach we can iterate through the pairs one by one.

Read
javascript

JavaScript program to mask the start digits of a phone number

Learn how to mask the start digits of a phone number in JavaScript. This program will use padStart method for that.

Read