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

How to remove spaces from a string in JavaScript?

In this tutorial, we’re going to look at different to replace and remove spaces from string in JavaScript. We’ll be using a combination of pre-defined string methods in JavaScript to start with, and then finish the tutorial with an example of how we’ll solve the issue manually, without any pre-defined methods. Let’s get right into … Read more How to remove spaces from a string in JavaScript?

JavaScript Alert (EVERYTHING you need to know!)

In this tutorial, we’ll be looking at the alert syntax in JavaScript. Let’s look at the different ways of using alert boxes to display messages and information on your browser screen. The alert function is a pre-defined function in JavaScript. It accepts one argument, and it displays whatever information is given to it, at the … Read more JavaScript Alert (EVERYTHING you need to know!)