SyntaxFix
Write A Post
Hire A Developer
Questions
if (/^\s+$/.test(myString)) { //string contains only whitespace }
this checks for 1 or more whitespace characters, if you it to also match an empty string then replace + with *.
+
*