Latest web development tutorials

JavaScript undefined property

Function Reference Manual JavaScript Global Functions

Definition and Usage

undefined property is used to store the JavaScript undefined value.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support undefined property


Examples

Examples

Determine whether a variable is defined:

<script>

var t1="";
var t2;

if (t1===undefined)
{
alert("t1 is undefined");
}
if (t2===undefined)
{
alert("t2 is undefined");
}

</script>

Examples of the above output:

t2 is undefined

try it"


Function Reference Manual JavaScript Global Functions