Re:Show HN: NodeScript- JavaScript Without the Variable Decl...
by pretodor on Monday February 20, 2017 @11:29AM
(#13688550)
Regarding the semicolons, due to the insertion mechanism JavaScript uses, lines starting with '[', '(', or '`' will get merged with the previous statement. So the example in the repo will get parsed in JavaScript as:
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.
Thanks for the kind words. I really appreciate it.
Thanks for the kind words. I really appreciate it.