Latest

recent

JavaScript undefined Property

Definition and Usage

The undefined property indicates that a variable has not been assigned a value.

Syntax

undefined


Example

In this example we will test two variables to find out if one of them is undefined:

<script type="text/javascript">
var t1="";
var t2;
if (t1==undefined)
{
document.write("t1 is undefined");
}
if (t2==undefined)
{
document.write("t2 is undefined");
}
</script>

The output of the code above will be:

t2 is undefined
JavaScript undefined Property Reviewed by 1000sourcecodes on 03:21 Rating: 5
Powered by Blogger.