[javascript] How to check if a variable is null or empty string or all whitespace in JavaScript?