How to replace string using replace & replaceAll functions in JavaScript !

In this video, you will learn 2 native JavaScript functions to replace string within a string with examples.

  1. String.replace()
  2. String.replaceAll()

Immediately Executing setInterval with JavaScript

The most common and best technique to call a function at the start of a setInterval is to call it before the first setInterval:

You may use this approach of a self-executing function that returns itself if you really want to isolate the function call to the setInterval:

The disadvantage of this design is that it creates a maintenance difficulty, as the next developer will have no idea what’s going on.

JavaScript Class Privates

Did you know that private variables and functions in classes may be created using a special syntax supported by browsers and the JavaScript language? Let’s have a look at it!

A # at the beginning of a property or method’s name makes it private: To make a property or method private, add a # to the beginning of its name.

JavaScript Input value VS valueAsNumber explained!

When you retrieve the value of an input[type=number], valueAsNumber returns the value as a Number type instead of the typical string representation.

Remove Space and Special Characters while typing using JavaScript & jQuery

Whenever you need to remove “space” as well as “special characters” between characters while typing, you can do it easily using native JavaScript & jQuery as described below :

Checkout this code in action,