Code working without the semicolon (how is that possible)

how is that possible that the code is being executed without the semicolon in the javascript code. please, someone, explain to me the concept behind it ???

@@@ javascript code below

var myVariable = “Bolt IoT”;
document.getElementById(“demo”).innerHTML = myVariable <<>>

@@@ HTML code below

<title>Javascript Vaiables</title>
<body>
<h1>JavaScript Variables</h1>
<p>Create a variable , assign a value to it , and display it:</p>
<p id="demo"></p>
<script src ="my_javascript2.js"></script>
</body>

@rachit.s.garg In JS, the semicolon is optional. It is recommended to use it but, it is not mandatory.