title: Javascript check if string contains only nbsp;
body: <p>This may be extremely trivial but I'm looking for a way to check if a string contains ONLY the html entity <code>nbsp;</code></p>
  
  <p>Example:</p>
  
  <pre><code>// checking if string ONLY CONTAINS nbsp;
  'nbsp;' -&gt; true
  'nbsp;nbsp;nbsp;nbsp;' -&gt; true
  'nbsp;nbsp; HELLO WORLD nbsp;' -&gt; false
  </code></pre>
  
  <p>How can I go about doing so? obviously the most concise efficient method would be ideal... any suggestions?</p>