Search This Blog

Friday, November 6, 2015

Difference between null and undefined in jQuery?

Null:



When user declares the variable values as empty in jQuery
Ex:

var a="";

function stringwrite()
{
alert(a) ; //Its shows null
}
undefined:

When user declares the variable values as none in jQuery


Ex:

var a;


function stringwrite()
{
alert(a) ; //Its shows undefined
}

No comments:

Post a Comment