on drops to the first statement after the while statements:
while (condition) {
...statements...
}
The following example examines a string for a specific character and stops its search when it finds it or runs out of characters to look for:
var found = false
n = 0
while (n <= searchString.length || !found) {
if (searchString.charAt[n] == "?")
found = true
else
n++;
}
with establishes a default object for a set of statements. Any property references without an object are assumed to use the default object:
with (object) {
statements...
}
The with statement is especially useful when applied to the Math object for a set of calculations. For example:
with (Math) {
var Value1 = cos(angle);
var Value2 = sin(angle);
}
replaces:
var Value1 = Math.cos(angle);
var Value2 = Math.sin(angle);