Vajid KagdiforHe Blogs Tooheyitsvajid.hashnode.netยทDec 25, 2022How to check for an empty/undefined/null string in JavaScript?To check for a truthy value: if (strValue) { // strValue was non-empty string, true, 42, Infinity, [], ... } To check for a falsy value: if (!strValue) { // strValue was empty string, false, 0, null, undefined, ... } Empty string (only!...37 readsHow TosJavaScriptAdd a thoughtful commentNo comments yetBe the first to start the conversation.