Make your own free website on Tripod.com

Data Types - Null and Undefined


Null

Undefined

Try the following program out.


var x;
var y = null;
var z = "";

document.write("x= " + x + "<P>");
document.write("y= " + y + "<P>");
document.write("z= " + z + "<P>");

if (y==z) document.write("y = z<P>");


Run the above program.

Try adding the statement

if (x == y) document.write("x = y<P>");

Run with the modification.

Back