//This is a comment
Comments can also be spread over several lines:
/*
This
is
a
multiline
comment*/
Note that every command in a JavaScript should end with a semicolon ";".
JavaScript is a weakly typed scripting language which means that no type declaration is
needed when creating variables and differently typed variables can be assigned to each
other.
//To create a variable use the keywork "var":
//Creates an integer variable with value 1
var numberVariable = 1;
//Creates a string variable with value "myString"
var stringVariable = "myString";
// Creates an array with the size of 4
var myArray = new Array(4);
Please note that the initialization "var variablename" leads to the deletion of the variable after
the script was processed. For JavaScript variables to be used globally, they need to be
initialized without the keyword var. It is preferred to use PClient variables to store important
data. JavaScript variables should not be used for that.