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
function isEmpty(value) { | |
// If any of these return true this function returns true. | |
return ( | |
// Null or undefined. | |
(value == null) || | |
// Check if a Set() or Map() is empty | |
(value.size === 0) || | |
// NaN - The only JavaScript value that is unequal to itself. | |
(value !== value) || | |
// Length is zero && it's not a function. |