Numbers

Numbers

A number is (unsurprisingly) a number. It can only contain numbers, and is used anytime you want to store values that can be increased/decreased or be used in a calculation.

 

Strings

Strings

A string is a piece of text. It starts and ends with a single ". Anything in between will be treated as written text, so it can not be used for calculations (even if it contains numbers).

In fact, adding one string to another just results in one longer string. Examples include "Hello" + "world" = "Helloworld" or (the slightly dumber) "13" + "37" = "1337".

 

Booleans

Booleans

A boolean is simply a value that is either true or false. It is very useful when building logic.

 

Arrays

Arrays

An array is a list of items (that can be of any data type, even another array). It starts with a [ and ends with a ]. The array can be of any length, an the items are separated with a , between them.

 

Objects

Objects

An object is a list of properties. It starts with a { and ends with a }. Every property has a key and a value, with a : between them. The key is the "name" of the property and the value is the data that the property holds. We use the keys to be able to get specific data from the object. The value can be of any type (even another object).