Friday , 22 March 2019
For Loop

For Loop – JavaScript Tutorial

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

Switch Statements – JavaScript Tutorial

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-5c956aba1a5a4844297753/] We have a variable named num and it’s value is …

Read More »
Logical Operators

Logical Operators – JavaScript Tutorial

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-5c956aba1b06a094412782/] Let’s focus on the if statement here. You’ll notice we have a && also known as a double ampersand. …

Read More »
Conditional Statements

Conditional Statements – JavaScript Tutorial

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-5c956aba1bae1469748802/] 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-5c956aba1c62a821821023/] There are many kinds of operators such as math operators, assignment …

Read More »
Parameters and Returns

Parameters and Returns – JavaScript Tutorial

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 »
Data Types

Data Types – JavaScript Tutorial

When working with variables, you have to think about the data types you want. While you don’t have to define the data types for any of your variables, it’s always good to know what data type your variable is. What are data types? In programming, all data you create can be categorized into what kind of data it is. Is …

Read More »
Including JavaScript

Comments and Variables – JavaScript Tutorial

Something you’ll find yourself using often are comments and variables. Knowing these 2 concepts is absolutely vital to JavaScript and programming in general. Before you get started, you must understand how statements work. Statements When your code is executed in the browser, any white space, indents, and new lines are all erased. While the browser doesn’t really care or need …

Read More »
Including JavaScript

Including JavaScript – JavaScript Tutorial

The first step for any project utilizing JavaScript would be including JavaScript in your web documents. This is relatively easy to do, but before we actually do anything, I would like to talk about organization. Organizing Your Files It’s important to be organized. Having all your scripts in one place allows you to manage your files easily and it prevents …

Read More »
Getting Started

Getting Started – JavaScript Basics Tutorial

JavaScript powers millions of sites worldwide everyday. Even this site utilizes JavaScript. JavaScript allows interaction between the user and the browser. JavaScript can also be used outside of the web. Not many know this, but you can also use JavaScript for server side programming and for creating apps! If you’re looking for a JavaScript tutorial, then you found it! This …

Read More »

Conclusion – PHP OOP Tutorial

This is the final tutorial. You now have a basic grasp on what object oriented programming is and how you can apply it to PHP. There’s more to it such as design. If you would like more information, then go here . One question, that I’ve been avoiding during this whole series is why use object oriented programming? Why use …

Read More »

Polymorphism – PHP OOP Tutorial

Polymorphism is a pretty big word, but it’s actually a simple concept to understand. Here’s how it’s officially defined. Polymorphism is a programming language feature that allows values of different  data types to be handled using a uniform interface. That may seem a little bit confusing to most of you new programmers. Luckily, polymorphism is a light switch concept meaning once you understand …

Read More »
Type Hinting

Type Hinting – PHP OOP Tutorial

In some cases, you’ll find yourself needing more information passed into your methods. What if you wanted to pass in objects into your methods? This is actually possible with type hinting. Let’s learn how to do this and why it would be useful. Before we begin, we’re going to create a new class called Apple. Create a file called apple.class.php …

Read More »
Chain Methods

Chain Methods – PHP OOP Tutorial

It’s time to make our Pet class a little more interactive. We can make our pets walk and rest. Our pet can do a chain of events. Using chain methods makes running multiple methods at once cleaner and more efficient. Let’s learn how to use chain methods. In our Pet class, add this bit of code. [crayon-5c956aba24dfd144381730/] We’re using a …

Read More »