Return to Snippet

Revision: 44626
at April 15, 2011 00:55 by dsoms


Initial Code
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;
}

Initial URL

                                

Initial Description

                                

Initial Title
Detect empty values in JavaScript

Initial Tags
javascript

Initial Language
JavaScript