Tuesday , 18 June 2019
Home / Tag Archives: JavaScript (page 8)

Tag Archives: JavaScript

Manipulating Loops – JavaScript Tutorial

Manipulating Loops

There will be a time where you’ll want to break out of a loop early or skip an iteration. Manipulating loops is possible in JavaScript. It’s actually very easy to do with conditional statements. Let’s clear our script and update our code to this. [crayon-5d0922aaa69ba454693737/] Manipulating Loops This is the exact example we used in our while loop tutorial. Let’s …

Read More »

Do While Loop – JavaScript Tutorial

Do While Loop

A do while loop is a special kind of loop. It’s a variation of the while loop, but with a special addition. Let’s learn how to use a do while loop. Creating A Do While Loop Clear your script and update your code to this. [crayon-5d0922aaa9748053351260/] You’ll notice everything is the same in our last tutorial, except our loop is …

Read More »

While Loop – JavaScript Tutorial

While Loop

We’ll be continuing with loops by learning about the while loop. The while loop is another way of looping through a block of code while a certain condition is true. Before we get started, let’s talk about iterations for a second Iterations An iteration is the technical term for a process that repeats itself. In the programming world, every time …

Read More »

For Loop – JavaScript Tutorial

For Loop

Loops are essential to know in JavaScript programming. Loops allow you to run the same block of code until it is broken. You could use a function and just call it again and again to run the same block of code, but a loop doesn’t need to be called to run continuously and you can manipulate how many times you …

Read More »

Switch Statements – JavaScript Tutorial

Switch Statements

Switch statements are similar to if statements. They allow you to check if a certain condition is true and then execute a certain block of code accordingly. Let’s take a look at how to create switch statements. Creating Switch Statements Clear your script and add this bit of code. [crayon-5d0922aaab466560046428/] We have a variable named num and it’s value is …

Read More »

Logical Operators – JavaScript Tutorial

Logical Operators

In this tutorial, we’ll be discussing what logical operators are. Logical operators allow you to define multiple conditions in one conditional statement. Let’s see how to do this. Using Logical Operators Clear your script and add this bit of code. [crayon-5d0922aaabc9a965225907/] Let’s focus on the if statement here. You’ll notice we have a && also known as a double ampersand. …

Read More »

Conditional Statements – JavaScript Tutorial

Conditional Statements

In this tutorial, we’re going to discuss what conditional statements are. In certain situations, you may want to perform some checks and respond accordingly. Let’s take a look at how to do this. Using Conditional Statements Conditional Statements are pretty easy to use. Clear your script and insert this bit of code. [crayon-5d0922aaac442984989112/] Let’s see what happens by opening our …

Read More »

Operators – JavaScript Tutorial


Operators allow you to tell your script exactly how a piece of data should interact with another piece of data. For example, if you wanted to add 2 pieces of data, then you would use the plus sign ( + ) operator. Here’s how that would look like. [crayon-5d0922aaac9d0006109874/] There are many kinds of operators such as math operators, assignment …

Read More »

Parameters and Returns – JavaScript Tutorial

Parameters and Returns

Today, we’ll be discussing what parameters and returns are. You’ll learn how to make your functions more robust and flexible by learning these 2 simple concepts. Before we begin, get rid of your button as we won’t need it anymore. Clear out your script as well. Using Function Parameters Parameters allow you to pass in more information to your function. …

Read More »

Functions – JavaScript Tutorial


Functions are blocks of code that run when you call it. There are 2 kinds of functions. There are predefined functions which are functions that JavaScript has already created for you. We’ve seen an example of this with the alert() function. Functions take care most of the work and we can call them as many times as we want without …

Read More »