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.
ReadHow 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.
ReadJavaScript 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.
ReadJavaScript 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.
ReadCheck if an array is a subarray of another array or not in JavaScript. We will learn 3 different ways to check for a subarray.
ReadJavaScript 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.
ReadLearn how to add padding to the end of a string in JavaScript. We will use padEnd method to add padding to the string end.
ReadJavaScript 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.
ReadJavaScript 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.
ReadLearn how to mask the start digits of a phone number in JavaScript. This program will use padStart method for that.
Read