title: How to check for string having only spaces in javascript
body: <p>In my code i need to write an if else block-</p>
  
  <pre><code>when the variable `currentValue` is holding only spaces -&gt; certain code
  </code></pre>
  
  <p>But i don't know how to write this condition as <code>currentValue</code> can be a string of any size. It can hold <code>" "</code>, <code>"    "</code>  etc.
  if i write <code>currentValue!=" "</code> it checks for single space.</p>