
How to check if String contains only spaces in JavaScript
In this article, we will see how to check if a string is empty or contains only spaces in JavaScript. Here, we will create a JavaScript function that will check…
Read more
Return multiple values from a function in JavaScript
In this tutorial, we will learn how to return multiple values from a function in JavaScript. Whenever we call a function in JavaScript it returns only one value using the…
Read more
How to multiply all numbers in an array using JavaScript
In this article, we will see how to multiply all the numbers in an array using JavaScript. Let’s say we have an array of numbers like this, [2,2,3,4] And we…
Read more
How to find exponent power of a number in JavaScript
In this article, we will learn how to find the power of a number in JavaScript. Here is a small example of getting the exponent power of a number. 62…
Read more
JavaScript – How to export multiple functions from a file
In this article, we will learn about different approaches to export multiple functions from a single Javascript file. In Javascript, ES6 has made it really easy to export multiple functions…
Read more
How to Get the ID of a Clicked Button or Element in JavaScript
In this article, we will learn how to get the id of any button when clicked using vanilla JavaScript. In JavaScript, we can get the id of any button using…
Read more
Convert Days to Seconds in JavaScript
In this tutorial, we will see how to convert days to seconds using JavaScript. Before writing the program we should know that: There are 24 hours in one day 60…
Read more
Use Array forEach() to loop through JavaScript object
In this article, we will see how to loop through an object and return the key and value using forEach() method in JavaScript. So, here, we will learn about 3…
Read more
Replace all occurrences of a string in JavaScript
If you are looking for “How to replace all occurrences of a string in JavaScript“, then the simple answer to it will be to use of String.replace() method with regular…
Read more