Hoisting variable declarations across script tags?

后端 未结 3 604
死守一世寂寞
死守一世寂寞 2021-01-20 16:25

I have the following code inserted into a html file:

3条回答
  •  囚心锁ツ
    2021-01-20 16:36

    Why? Because the second script is not considered when the first one runs. The behaviour you describe, declaring all variables first before executing code, applies only to every individual block of code.

提交回复
热议问题