Skip to content

Instantly share code, notes, and snippets.

@WillSquire
Last active December 23, 2015 12:33
Show Gist options
  • Save WillSquire/e503cd7859c486583afd to your computer and use it in GitHub Desktop.
Save WillSquire/e503cd7859c486583afd to your computer and use it in GitHub Desktop.
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}
*/
export 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}
*/
function empty($value) {
return ($value === null || $value === '' || typeof $value === 'undefined');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment