3 ms·
Regarding the semicolons, due to the insertion mechanism JavaScript uses, lines starting with '[', '(', or '`' will get merged with the previous statement. So t
by pretodor 10y ago
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.