SyntaxFix
Write A Post
Hire A Developer
Questions
Old question, but I think it deservers a simpler answer.
You can simply do:
var addr = " "; if (addr && addr.trim()) { console.log("I'm not null, nor undefined, nor empty string, nor string composed of whitespace only."); }