Skip to content
Advertisement

Tag: let

What is the purpose of the script scope?

When inspecting scopes of a function in the DevTools console I noticed a “script” scope. After a bit of research it seems to be created for let and const variables. Scopes of a function in a script without const or let variables: Scopes of a function in a script with a let variable: Yet the following prints 1 in the

Advertisement