Definition and Usage The undefined property indicates that a variable has not been assigned a value. Syntax undefined Example In t...
Definition and Usage
The undefined property indicates that a variable has not been assigned a value.
Syntax
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: