Created
March 2, 2019 09:41
-
-
Save DejanBelic/141ef5c2a00aa367cea485518e140367 to your computer and use it in GitHub Desktop.
Is empty function javascript
This file contains hidden or 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
const isEmpty = value => | |
value === undefined || | |
value === null || | |
(typeof value === "object" && Object.keys(value).length === 0) || | |
(typeof value === "string" && value.trim().length === 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment