How to convert a string to float in JavaScript – The Ultimate Tutorial

In this tutorial, let’s look at the different ways to convert a string to a floating-point number. We’re not just going to stop after looking at the obvious parseFloat method. We’re going to delve further into the different ways to use the common JavaScript operations and methods to achieve the same parsed result. Let’s get … Read more How to convert a string to float in JavaScript – The Ultimate Tutorial

How to create multiline string in JavaScript – 4 different methods

In this tutorial, let’s look at the different ways to create a multiline string in JavaScript. Multiline strings are, as the name implies, strings that span over multiple new lines, or paragraphs. If you notice, you can’t really create new lines in a normal string. You’ll get an error. If you run the above lines … Read more How to create multiline string in JavaScript – 4 different methods

How to check for empty string in JavaScript – A detailed guide

In this tutorial, let’s check for an empty string in JavaScript. We’ll be looking at multiple method, starting from the simplest one. Simplest method: Use an If Else statement to return a true or false The simplest way to check if a JavaScript string is empty is by using an If Else statement, and a … Read more How to check for empty string in JavaScript – A detailed guide

How to find the sum of numbers using a for loop in JavaScript?

In this tutorial, let’s learn how to find the sum of numbers using a for loop in JavaScript. It’s a very simple solution, so let’s quickly look at it. Sum of numbers within a range using a for loop To start with, we’re going to create our HTML page. We’re going to have a h1 … Read more How to find the sum of numbers using a for loop in JavaScript?

How to create a counter in JavaScript – Multiple methods

In this tutorial, let’s look at how to create a counter in JavaScript. We’ll be creating 3 types of counters here: a click counter, an increment and decrement counter, and finally, an animated counter that counts down on its own. Let’s get right into it then! Click counter in JavaScript Let’s start with the click … Read more How to create a counter in JavaScript – Multiple methods

How to print Odd Numbers in JavaScript – Multiple methods

In this tutorial, let’s look at the different ways to print odd numbers in JavaScript. We’ll be using the ‘modulus’ operator to figure out whether a number is an odd number or not. We’ll be looking at different problem statements (printing odd numbers within a range, within a user given range and within an array) … Read more How to print Odd Numbers in JavaScript – Multiple methods