Check a Variable isEmpty in JavaScript

<script type="text/javascript" >

function isEmpty(obj) {
    if (typeof obj == 'undefined' || obj === null || obj === '') return true;

    if (typeof obj == 'number' && isNaN(obj)) return true;

    if (obj instanceof Date && isNaN(Number(obj))) return true;

    return false;
}
var b = 10;

var a;

/* Empty/Null Check in Javascript */
document.writeln(isEmpty(a));

document.writeln(isEmpty(b));
</script>