letgives us the same scope as
I personally still don't understand how this can work. I just did a simple test where I defined a variable with
var at the scope of my main and not even that is working. Trying to use it from the console still gives an error indicating that the variable is undefined.
You are using some kind of magic and I feel left out.
Edit: I thought about it some more and I see now that the console command you tried in the screenshot still doesn't work for you either. Your issue was with your script and you tried to copy the statement to the console.
Was the error you got in the script, temporarily, exactly the same as the one you got when you tried running the statement in the console window?