Ups. det jeg sagde var galt. undefined kan bruges som navn (uden citationstegn).
Men det kan kun relatere til variable. funktioner returnerer en værdi og hvad en given funktion end returnerer er det noget, ikke undefined.
fra:
http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm \"Client-Side JavaScript Reference v1.3\"
The value undefined.
Core property
Implemented in JavaScript 1.3
ECMA version ECMA-262
Syntax
undefined
Description
undefined is a top-level property and is not associated with any
object.
A variable that has not been assigned a value is of type undefined. A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value.
You can use undefined to determine whether a variable has a value. In the following code, the variable x is not defined, and the if statement evaluates to true.
var x
if(x == undefined) {
// these statements execute
}
undefined is also a primitive value.