Determines if the given text is only comprised of whitespace.
This is null | undefined safe. If you pass null | undefined then this will return true.
null | undefined
true
isWhitespace(null); // trueisWhitespace(" "); // trueisWhitespace("\n\t"); // trueisWhitespace("Hello"); // false Copy
isWhitespace(null); // trueisWhitespace(" "); // trueisWhitespace("\n\t"); // trueisWhitespace("Hello"); // false
Determines if the given text is only comprised of whitespace.