MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 224

Actionscript language reference
Table of Contents

Advertisement

undefined
Availability
Flash Player 5.
Usage
undefined
Parameters
None.
Returns
Nothing.
Description
A special value, usually used to indicate that a variable has not yet been assigned a value.
A reference to an undefined value returns the special value
typeof(undefined)
is
.
undefined
The value of
undefined.toString()
The value
undefined
compared with the equality (
are compared with the strict equality (
undefined
Example
In the following example, the variable
. In the first section of code, the equality operator (
undefined
value
undefined
the equality (
) operator compares the values
==
// x has not been declared
trace("The value of x is "+x);
if (x == undefined) {
trace("x is undefined");
} else {
trace("x is not undefined");
}
trace("typeof (x) is "+typeof (x));
if (null == undefined) {
trace("null and undefined are equal");
} else {
trace("null and undefined are not equal");
}
The following result is written to the log file.
The value of x is undefined
x is undefined
typeof (x) is undefined
null and undefined are equal
224
Chapter 5: ActionScript Core Language Elements
ActionScript Core Language Elements
returns the string
is similar to the special value
) operator, they compare as equal. However, when
==
x
, and the appropriate result is sent to the log file. In the second section of code,
undefined
. The only value of type
"undefined"
is
.
undefined
. When
null
) operator, they compare as not equal.
===
has not been declared and therefore has the value
and
null
undefined
CHAPTER 5
. The ActionScript code
undefined
and
null
undefined
null
) compares the value of
==
.
are
and
to the
x

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents