When working with more complex scripts you might face a situation in which you would have many more or less
Instead of being forced to write a line for each operation
done to such a variable, you can use arrays to help you automate the process.
Consider this example:
Example 1||Example 2 |
here would go 96 similar lines
for (number=1; number<=100; number=number+1)
In example 1 you would need to enter 100 lines to perform an operation on your variables.
In example 2 you only need to enter 3 lines no matter how many variables you have.
An array must be defined before referring to any of the
variables in it.
This is done using the syntax: variablename=new Array;
Replace variblename with the desired name of your array.
Note: new must be written in small letters and Array must start with a capital A.
As the example indicated, arrays become extremely powerful when used in combination with loops.
However, you don't have to handle array variables in loops.
Single variables can be addressed with a syntax like this:
You have reached the end of the tutorial!
in this section you should continue by learning about the
Objects are predefined functions for maths, text variables, browser controlling, etc.
That is where you really start taking your pages beyond