DEV Community


Discussion on: 🛑Stop using `this` instead use `globalThis` for global variables

huncyrus profile image

Quite interesting and good to know, could help quick prototyping, especially if accessible from multiple files.
But then some question, what I did not found at the first search:

  • execution order? (can it lock, overwrite, how consistent it could be?)
  • can a forked process also reach the same or every started process shall have its own 'global this'?

I'm curious what people opinion is, especially if we thing on other languages - somewhat - strict general practice what basically start with: 'Do not use global, nor enabled them'.

Forem Open with the Forem app