Last active
February 24, 2025 09:26
Revisions
-
bhaireshm revised this gist
Apr 22, 2021 . 1 changed file with 6 additions and 16 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,20 +3,10 @@ */ function isEmpty(data) { if (typeof data == "number" || typeof data == "boolean") return false; if (typeof data == "undefined" || data === null) return true; if (typeof data.length != "undefined") return data.length == 0; let count = 0; for (let i in data) if (data.hasOwnProperty(i)) count++; return count == 0; } -
bhaireshm revised this gist
Mar 25, 2021 . No changes.There are no files selected for viewing
-
bhaireshm created this gist
Mar 25, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ /** * @param data - any datatype value. */ function isEmpty(data) { if (typeof data == "number" || typeof data == "boolean") { return false; } if (typeof data == "undefined" || data === null) { return true; } if (typeof data.length != "undefined") { return data.length == 0; } let count = 0; for (let i in data) { if (data.hasOwnProperty(i)) { count++; } } return count == 0; }