79406015

Date: 2025-02-02 03:18:22
Score: 0.5
Natty:
Report link

Apart from the technical answers above, below answer serves as a simple mental model to fit the purpose of Script scope. Mental Model : We might want to declare some global variables but don't want to assign those variables to the global object ( reason : unnecessary polluting attributes of an global object ), in that case we use let/const(at top level). And to make sure above works, we need a way to show that these variables are global but not attached to the global object. Thus they have added a Script scope [ following the terminology from Chrome Dev tools ]

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Code learner