Tag Archives: Javascript

JavaScript – Switch Case

In the last JavaScript tutorial, we learned about JavaScript if…else statements. Where we used if statement when we want to execute a block of code based on a single condition, if….else statement to execute either of one statement between two blocks of code based on a single condition, and if….else if….. statement when we have multiple conditions and… Read More »

JavaScript Function

A function is a container for a block of the code, that is used to perform a specific task. Using the function we can divide a big program into smaller modules or subparts. A function is like a small encapsulated block of code that can be called anywhere throughout the Program. There are two types of functions in… Read More »

JavaScript While Loop

In the previous two JavaScript tutorials, we discuss how can we use the if…else and switch case statements in JavaScript to execute a specific block of code based on single and multiple conditions. In this tutorial, we will learn about the concept of while loop in JavaScript which can execute a block of code again and again based… Read More »

JavaScript For Loop

For loop is one of the most common looping structures provided by all the high-level programming languages. In the previous JavaScript tutorial, we discuss how can we use while and do..while loop in JavaScript to execute a block of code repeatedly, in this tutorial we will learn about the JavaScriptfor loop. JavaScript for loop Statement Similar to the… Read More »

JavaScript Operators

What is an Operator in JavaScript? An Operator can be a symbol, sign or keyword, that operates on operand (values) and return a result. For example * is an Arithmetic Multiplication operator, and it can be operated between two numerical operands(data values), 5*3 , and return the multiplication of 5 and 3 as a result. JavaScript supports major… Read More »

JavaScript Variables

What are Variables in JavaScript When we write the JavaScript code we deal with many types of data it could be a number, name, date, speed value, etc., and to use these values we require variables. A variable is a data container or storage which holds the data value for us. To create a variable in JavaScript we… Read More »

JavaScript Syntax

The JavaScript code cannot execute standalone, it needs to be embedded in the HTML file inside the HTML <script> tag. JavaScript Syntax There are two ways, to embed a JavaScript code in an HTML file. Internal JavaScript External JavaScript Internal JavaScript Code In the Internal JavaScript code, we write the complete JavaScript code inside the HTML document between… Read More »