This is down to changes that were made for new versions of ZPE.
But since it is also loosely typed, a variable can have it's type changed after it has been declared.
The six primitive types are:
Take the following code sample:
var x = "Hello world"; //String var x = 50; //Number var x = true; //Boolean
In this example a variable
x has been declared three times with three
different values. Crucially however, the values all differ in type. The first
value is a string and therefore the String type is assigned, the second value is a numeric value and
therefore the Number type is assigned and the thrid value is a boolean value (
false) and therefore has the Boolean type assigned to it.
Despite the difference in types, it is possible to assign a value of a different type to the same variable because the language is loosely typed.
Null is a special type that means that the value of the variable is actually
it can be assigned just like a normal value:
var x = null; //Null
var x = undefined; //Undefined
There is more on the undefined value on Wikipedia.
S1s and S2s really enjoyed the lesson on cybercrime using the lesson on How to Rob A Bank on… https://t.co/MxjDYE2JFu
7 months ago
S2s doing really well in hardware test! Also really enjoying doing tests electronically rather than on paper.… https://t.co/ritdfcW6Mw
7 months ago
S1 and S2 pupils listing input and output devices and giving answers such as keyboard and mouse but there were also… https://t.co/dGxDkYqFxo
8 months ago