When checking function areas in the DevTools console, I noticed a "script" area. After a little research, it is created for the let and const variables.
Areas of function in script variables without const or let :

Function areas in a script with let variable:

However, the following paths 1 in the console: variables in the script area can be accessed from other scripts:
<script>let v = 1</script> <script>console.log(v)</script>
I heard about ES6 modules in which top-level variables will not be accessible from outside the module. Is this what scope is used or has a different purpose?
source share