What does the regex \S mean in JavaScript?

javascript, regex

Solution

`\s` matches whitespace (spaces, tabs and new lines). `\S` is negated `\s`.

Problem

What does /\S/ mean in a regex? ``` while (cur ! = null) { if (cur.nodeType == 3 && ! /\S/. test(cur.nodeValue)) { element. removeChild(cur); } else if (cur. nodeType == 1) { cleanWhitespace(cur); } } ```

Original source

Related problems