Edit in JSFiddle

console.log(myVariable);
<html>
  <body>
    <script type="text/javascript">
        var myVariable = 4;
    </script>
  </body>
</html>