I have what I believe is valid javascript. However I get this: SyntaxError: Unexpected token '<'. Removing any of the script blocks, or changing around the order in the 'a' string fixes the issue. Why is that?
<script>
let a = "<!-- <script>";
</script>
<script></script><!-- --><script></script>


<script>is not legal javascript. It is a signal to HTML that what comes next is javascript.<scriptis disallowed in embedded script. What you have above is a minor variation of the very first Example in that section.