Regular Expression in JavaScript

What is a Regular Expression(RegEx)? Regular expressions/sequence of characters are patterns used to match character combinations in strings. A regEx can be a single character or a complicated pattern. Regular expressions can be used to perform text search and validation operations. Special characters in regular expressions Character Meaning ^ It Matches the beginning of an input e.g., … Read more

Global in JavaScript

Global scope is a JavaScript function Scope.Scope determines the accessibility (visibility) of variables. Variables defined inside a function are not accessible (visible) from outside the function. A global variable is declared outside the function or declared with an object. It can be accessed from any function. Declaring global variable within function To declare global variables within … Read more

JavaScript Introduction

What is Javascript? Javascript (JS) is a high-level, interpreted programming language used in web development. It is a language which is also known as dynamic, loosely typed and multi-paradigm. Along with HTML and CSS, Javascript is one of the three main technologies of the World Wide Web. Brief history of Javascript JavaScript was created by … Read more

Loop Control Statement in JavaScript

The Break Statement The break statement can be used to jump out of a loop even when the condition is true. The break statement breaks the loop and continues executing all the code after the loop(if any):


This time though, we want to stop execution of the loop when i become 3. To do so, we are … Read more

Reserved Words in JavaScript

JavaScript reserved words are some reserved words that can’t be used as identifier and are used to identify actions to be performed e.g., the var keyword tells the browser to declare variables in JavaScript. Here is the list of JavaScript keywords: abstract arguments await boolean break byte case catch char class const continue debugger default delete do double else enum … Read more

Variables in JavaScript

A JavaScript variable is simply a name of a storage location. There are two types of variables in JavaScript: Local variable Global variable There are some rules for declaring a JavaScript variable: Name must begin with a letter (a-z or A-Z), underscore ( _ ), or dollar( $ ). After first letter digits (0-9) can be used … Read more

Enabling JavaScript

JavaScript needs to be enabled by the client side browser. Generally,  all the modern browsers have built-in support for JavaScript.  If you disable JavaScript, the text will be changed as the events will not be fired. How to enable JavaScript? Different browser has different procedure for enabling JavaScript. Here are the simple steps to turn … Read more

Switch Statement in JavaScript

The switch statement performs different actions based on different condition. It can be called as the replacement of multiple nested if-else statements. The JavaScript Switch Statement The switch statement is used to select one of many code blocks to be executed. Switch case is useful for menu based application. Syntax

How Switch Statement works? … Read more

Loop (Iteration) Statements in JavaScript

Loop(Iteration) Statement A loop describes the process in a software program/script that repeats the same set of instructions over and over until it receives the order to stop. Loops offer a quick and easy way to execute something repeatedly. There are 4 types of loop in JavaScript: for statment for/in statement while statment do/while statement for Statement The for is a … Read more

If Else Statement in JavaScript

Conditional Statements The conditional statements are used to perform different actions for different decisions. Just like any other languages, JavaScript has the following conditional statements: if for specifying a block of code to be executed, when a specified condition becomes true else to specify a block of code to be executed, when the condition is false else … Read more