about variable declarations in node /javascript: var, let const, ...
I experimented in a node script
that if one declares a variable without any statement (var
, let const
, ...)
x = "my new var";
then x
will have a global scope and will be visible from all the modules of the node project
question
Is it correct to declare a variable like that? or is it deprecated / contrary to the rules of language?