Category Archives: Javascript

JavaScript Nested Functions and Closures

In the last JavaScript tutorial, we learned about JavaScript function Scope and how the global and local Scope and variables work in JavaScript. If you do not know what are global and local scopes please check that tutorial first, because in this tutorial we will be frequently referencing both terms. JavaScript Nested Functions In JavaScript, we can define… Read More »

Javascript Object Properties

Properties are the technical term for JavaScript name:value pairs. JavaScript Properties In the previous JavaScript tutorial, we learned what is an Object in JavaScript and how we define them. Just for a quick reference, a JavaScript object is a collection of name:valuepairs separated with commas, inside curly brackets. We can treat the individual name:value pair as a property… Read More »

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 for…..in and for….of loop

In the previous tutorial, we learned about JavaScript for…loop which syntax is similar to other programming languages for a loop. But in JavaScript, we get two more types of for loops for specific conditions. JavaScript for…in Loop JavaScript for…in Loop JavaScript for..in loop The for..in loop is used to iterate over the keys of the JavaScript object. In… Read More »