Computer >> Computer tutorials >  >> Programming >> Javascript

Does it make sense to use HTML comments on blocks of JavaScript?


No, there is no need of using HTML comments on a block of JavaScript. This was followed in the 1990s. The browsers do not exist now, which wanted you to use HTML comments in JavaScript.

You can use CDATA,

<script charset="utf-8">
   /* <![CDATA[ */
   /* ]]> */
</script>