- Code: Select all
function empty (mixed_var)
{
var key;
if (mixed_var === "" ||
mixed_var === 0 ||
mixed_var === "0" ||
mixed_var === null ||
mixed_var === false ||
typeof mixed_var === 'undefined')
{
return true;
}
if (typeof mixed_var == 'object')
{
for (key in mixed_var)
{
return false;
}
return true;
}
return false;
}
this function determines if a variable is empty, which can be quite useful.


