Variables, Misc
null
Usageundefined
- Indicates the lack of a value.
- Variables and properties that contain no value
- Unspecified parameters
- Functions that returned no value
Examples
- A variable or property can be assigned a value of "null", to indicate that it no longer contains a value.
if (myStr != null) {
myStr = null;
}
Usagevoid
Examples
- The default value for new variables and properties.
- Indicates that a variable or property has not yet been assigned a value.
if (myStr == undefined) {
myStr = "hello";
}
Usage
Examples
- Indicates that a function does not return a value (specifically, the function returns a value of type Void).
function foo():Void {
...
}