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

Datatype in JavaScript

JavaScript in Internal File Like other programming languages, JavaScript also provides 2 different data types to hold different types of values. Here are the two types of data types: Primitive data type Non-primitive data type JavaScript is a dynamic type language, which means the type of the variable doesn’t need to be specified (it is dynamically used 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):

OUTPUT

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

Popup Box in JavaScript

JavaScript supports three types of dialog boxes: Alert box Confirmation box Pop up box Alert Box An alert dialog box is mostly used to give a warning message to the users especially for validation purposes when a use inputs some wrong data, we can use an alert box to display a warning message. The drawback … Read more