nullis not the same as
NULL, or any other variant.
Dateobject and its methods to handle dates. Objects and functions are the other fundamental elements in the language. You can think of objects as named containers for values, and functions as procedures that your application can perform.
var answer = 42And later, you could assign the same variable a string value, for example,
x = "The answer is " + 42The first statement returns the string "The answer is 42." The second statement returns the string "42 is the answer."
y = 42 + " is the answer."
varto declare a global variable is optional. However, you must use
varto declare a variable inside a function. You can access global variables declared in one window or frame from another window or frame by specifying the window or frame name. For example, if a variable called
phoneNumberis declared in a
FRAMESETdocument, you can refer to this variable from a child frame as
parent.phoneNumber. For information on using variables across frames and windows, see Chapter 4, "Using Windows and Frames."
Integers can be expressed in decimal (base 10), hexadecimal (base 16), and octal (base 8). A decimal integer literal consists of a sequence of digits without a leading 0 (zero). A leading 0 (zero) on an integer literal indicates it is in octal; a leading 0x (or 0X) indicates hexadecimal. Hexadecimal integers can include digits (0-9) and the letters a-f and A-F. Octal integers can include only the digits 0-7.
Some examples of integer literals are: 42 0xFFF, and -345.
A floating-point literal can have the following parts:
") or single (
') quotation marks. A string must be delimited by quotation marks of the same type; that is, either both single quotation marks or both double quotation marks. The following are examples of string literals:
For characters not listed in Table 8.1, a preceding backslash is ignored, with the exception of a quotation mark and the backslash character itself.
You can insert a quotation mark inside a string by preceding it with a backslash. This is known as escaping the quotation mark. For example,
var quote = "He read \"The Cremation of Sam McGee\" by R.W. Service."
The result of this would be
He read "The Cremation of Sam McGee" by R.W. Service.
To include a literal backslash inside a string, you must escape the backslash character. For example, to assign the file path
c:\temp to a string, use the following:
var home =
Last Updated: 11/26/97 09:25:48