Last active
December 23, 2015 12:33
-
-
Save WillSquire/e503cd7859c486583afd to your computer and use it in GitHub Desktop.
empty() function.
Checks if a variable is empty or not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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