You can safely remove all JavaScript comments indicated by //
or /* */
. They offer no value to the typical end-user and just increase file size. You do need to be aware that script-masking comments such as this:
<script type="text/javascript">
<!--
alert("code here");
//-->
</script>
might be useful to preserve in the case of non-JavaScript-aware bots or old browsers. It is probably best to include scripts outside the document, however, as it is easier to make them XHTML-compliant.