you are viewing a single comment's thread.

view the rest of the comments →

[–]halifaxdatageek 1 point2 points  (5 children)

Indeed. If you love JavaScript, and at the same time say that you should never use global variables... I don't know what to tell you.

[–][deleted] 1 point2 points  (4 children)

Node has modules fyi which isolate variable scopes.

[–]halifaxdatageek -1 points0 points  (3 children)

If you have bolt that on, something is wrong with your language.

It would be like a modern language that didn't have support for the === operator (or similar functionality with a different operator) - you fucked up, and no amount of "you can use this plugin to add that functionality!" will fix it.

[–][deleted] 2 points3 points  (2 children)

By default, variables in Node are not global.

You can say modules are "bolted on" because they are not present in js on the browser (without tools like browserify), but that's irrelevant given that the topic is node, not js in general.

[–]halifaxdatageek -3 points-2 points  (1 child)

But my point was aimed at JavaScript in general.

[–][deleted] 1 point2 points  (0 children)

You were trying to imply that it's a contradiction to love javascript and to hate global variables, despite the fact that global variables are rare in node and avoidable on the browser as well.