我来自Java,并在许多地方发现了与Java类似的语言。最近,我遇到了一个程序,在if-else块中的变量声明之前引用了变量,为什么它不会引发语法错误?
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<figure class='box'>
<audio src='http://soundbible.com/mp3/chinese-gong-daniel_simon.mp3' controls></audio>
<figcaption class='skip'>
<button class='prev'>⏪</button>
<button class='next'>⏩</button>
<output class='item'>1</output>
</figcaption>
</figure>
<script>
<!--Place JS here. The end tag of /body> should be the-->
<!--only thing to follow the last < script > tag -->
</script>
</body>
</html>