WillSquire
6/18/2015 - 11:09 AM

empty() function. Checks if a variable is empty or not.

empty() function. Checks if a variable is empty or not.

/**
 * Checks if a variable is empty or not.
 * @author Will Squire <will_squire@hotmail.co.uk>
 *
 * @param $value
 * @returns {boolean}
 */
function empty($value) {
    return ($value === null || $value === '' || typeof $value === 'undefined');
}
/**
 * Checks if a variable is empty or not.
 * @author Will Squire <will_squire@hotmail.co.uk>
 *
 * @param $value
 * @returns {boolean}
 */
export function empty($value) {
    return ($value === null || $value === '' || typeof $value === 'undefined');
}