title: Filtering "whitespace-only" strings in JavaScript
body: <p>I have a textbox collecting user input in my JS code. I would like to filter junk input, like strings that contain whitespaces only.</p>
  
  <p>In C#, I would use the following code: </p>
  
  <pre><code>if (inputString.Trim() == "") Console.WriteLine("white junk");
  else Console.WriteLine("Valid input");
  </code></pre>
  
  <p>Do you have any recommendation, how to do the same in JavaScript?</p>