title: Should I use HTML comments to capsulate JavaScript code blocks?
body: <p>Some years ago, I was taught that JavaScript code blocks embedded inside HTML should always be capsulated inside HTML comments as following:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  &lt;!--
  var hello = "world";
  --&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>I was told to do this, but I never kind of fully figured out why. It kind of seems hacky to use HTML comments, so nowadays I have started using writing my JavaScript code inside the script block without the HTML comments:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var hello = "world";
  &lt;/script&gt;
  </code></pre>
  
  <p>So my question is: should I use HTML comments to capsulate JavaScript code blocks? Is it safe to just write the script without the comments? I mean am I risking something when I leave out the comment tags?</p>