Return to Snippet

Revision: 41124
at November 2, 2011 22:06 by magna


Updated Code
/** helper to determine if a variable is defined
 */
function isDefined(foo) {
    return 'undefined' !== typeof(foo) && null != foo;
}

Revision: 41123
at February 12, 2011 12:16 by magna


Initial Code
/** helper to determine if a variable is defined
 */
function isDefined(foo) {
    return typeof(foo) !== 'undefined' && foo != null;
}

Initial URL


Initial Description


Initial Title
determine if a variable is defined

Initial Tags


Initial Language
JavaScript