Show HN: useStore() - a reactive alternative to React's useState()
github.com1 pointsby pretodor0 comments
// NodeScript
x = 10
function outer() {
y = 20
function inner() {
x = 100
y = 200
}
inner()
console.log(x, y)
}
outer()
# Python
x = 10
def outer():
y = 20
def inner():
global x
nonlocal y
x = 100
y = 200
inner()
print(x, y)
outer() x = 10;
y = 20[x, y] = [y, x];
Your assumption is correct. NodeScript defaults to let-declarations. This leaves you with a block-scoped language and prevents leakage of global variables. If you want to make a global variable, you will have to explicitly write it as a property of the global object.
It's available in Google's cache.[1]
[1] http://webcache.googleusercontent.com/search?q=cache:https:/...