'Does `script scope` exist? [duplicate]

JavaScript has 3 types of scope:

  • Block scope
  • Function scope
  • Global scope

enter image description here

let and const are not mounted on window, but on script. What is script? Can I understand it as Global scope? I don't understand it very well, so I hope you can help me. Thanks!



Solution 1:[1]

If you add multiple script tags to a HTML File with multiple variables the script scope the scope of a particular variable inside one of the script comes as a Script Scope. In Firefox devtools simply call such a scope "block" as because variables in the scirpt scope can be accessed in another script tag(including the external ones).

For A Much Detailed Explanation You Can Read The Following Answer

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mrtechtroid