How do I detect if a string has any whitespace characters?
The below only detects actual space characters. I need to check for any kind of whitespace.
function hasSpaces(str) { if (str.indexOf(' ') !== -1) { return true } else { return false } }