What does the term mean?

An API provides a means for one piece of code to talk to another in a way that both will understand by providing instructions and tools.

This is especially relevant if one piece of code is written in another language to the other.

Some examples being:

  • plugins for a CMS
  • exporting data into a JSON file
  • modifications (mods) for computer games

What does the term mean?

A special kind of variable, used to pass pieces of data from one piece of code (a program, subroutine or function) to another.

When an argument is used as part of that function, it is instead called a parameter.

For example, you have a piece of code that makes toast, it might have parameters that take people’s choice of colour, their desire for butter and their wish for jam. The choices available for such parameters are called called arguments.

What does the term mean?

A type of operator which uses numbers to perform simple mathematic equations. It is made up of two operands .

For example, if you were to say x + y the letters x and y are your operands. When you then ask the computer to show you the value of this expression you would get sum of those two values.

Although they vary in how they are written between languages, the arithmetic operators are roughly as follows:

OperatorExampleDescription
+2 + 3 returns 5the right value added to the left value
2 – 3 returns -1the right value subtracted from the left value
*2 * 3 returns 6the right value multiplied by the left value
/2 / 3 returns 0.6666666666the right value divided by the left value
%2 % 3 returns 2the remainder of the right value divided by the left value
**2 ** 3 returns 8the left value to the power of the right value

What does the term mean?

A type of variable that can store multiple pieces of information and sort these pieces in a specified manner.

Arrays store values, sometimes alongside a key that identifies that value. Stroed values can be retrieved at another point, or be modified.

An array lets you add new items, delete items and rearrange the items inside it.

Think of a basic array – or indexed array – being like the following table:

IndexValue
0Jane Doe
1John Doe

Each row is a value stored within the array, the more items you add, the longer the array gets. Each value is assigned a number to identify it, starting at 0 and increasing by 1 for each new value. This number is known as an index.

In pseudo code you may write:

people = array("Jane Doe","John Doe");
print "My name is " . people[1];

Which would return “My name is John Doe”.

More complicated arrays, known as associative arrays, can use a specific name as a key for the values contained within it. Not all languages support this type of array e.g. Javascript.

To extend the example above, think of an associative array as the following table:

IndexKeyValue
0Jane Doe32
1John Doe46

Each row is a value and key pair. This pair is still assigned an index, but you can retrieve a specific value by using the key. So, if we wanted Jane’s age (the value) we would ask the array for the value of key ‘Jane Doe’.

In pseudo code you may write:

age = array("Jane Doe"=>"32","John Doe"=>"46");
print "Jane Doe is age " . age["Jane Doe"];

Which would return “Jane Doe is age 32”.

Even more complicated than that are multidimensional arrays, which are arrays nested within other arrays. Not all languages support this type of array e.g. Javascript.

Index Value
0
Index Value
0 Jane Doe
1 Jack Doe
1
Index Value
0 John Doe
1 Jill Doe

In pseudo code you may write:

children = array(array("Jane Doe","Jack Doe"),array("John Doe","Jill Doe"));
print children[0][0] . " has a child called " . children[0][1];

Which would return “Jane Doe has a child called Jack Doe”.

What does the term mean?

A type of operator which allows you to perform actions on two or more arrays and their contents.

Although they vary in how they are written between languages, the array operators are roughly as follows:

OperatorExampleDescription
+apples=[“russet”=>2,”cox”=>5,”golden delicious”=>2]
pears=[“dessert”=>3, “conference”=>2]

 

apples + pears returns [“russet” => 2, “cox” => 5, “dessert” => 3, “conference” => 2]

Makes a new array containing all items from the arrays (also known as a union)
==agesString = [“Andy” => “32”, “Barry” => “42”];
agesNumber = [“Andy” => 32, “Barry” => 42];

 

agesString == agesNumber returns true

Returns true or false. For true, the arrays must have the same key/value pairs
===agesString = [“Andy” => “32”, “Barry” => “42”];
agesNumber = [“Andy” => 32, “Barry” => 42];

 

agesString === agesNumber returns false

Returns true or false. For true, the arrays must have the same key/value pairs and these must be the same data type
!= or <>agesString = [“Andy” => “32”, “Barry” => “42”];
agesNumber = [“Andy” => 32, “Barry” => 42];

 

agesString == agesNumber returns false

Returns true or false. For false, the arrays must have the same key/value pairs
!==agesString = [“Andy” => “32”, “Barry” => “42”];
agesNumber = [“Andy” => 32, “Barry” => 42];

 

agesString === agesNumber returns true

Returns true or false. For false, the arrays must have the same key/value pairs and these must be the same data type