5 visitors online
Strings are blocks of text, e.g. 'made of cheese'. Variables are numbers, like '15' or '200'.
Defining and calling variables:
Arithmetic operators work on one or more numeric values yielding a single result.
- + Addition
- - Subtraction
- * Multiplication
- / Division
- % Modulus
- ++ Increment by 1
- -- Decrement by 1
What is Modulus?
var a = 70 % 16;
(a is now equal to 4, since the remainder left after dividing 70 by 16 is 4)
var b = 64 % 8;
(b equals 0)
Text must be stored as a string:
var name = "Cristiano Ronaldo";
var club = 'Manchester United';
var position = "Attacking Midfielder/Forward left";
var squad_number = "7";