Different global objects will expose very different APIs, so now instead of having to check if (typeof global !== 'undefined') global.nodeFeature(), you can now check:
Yeah I guess that was my concern. If the different 'this' you're targeting can have radically different APIs, I would wonder why target them with a single globalThis instead of individually. I figured I was missing something..
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
"As consistent as it can get".
Different global objects will expose very different APIs, so now instead of having to check
if (typeof global !== 'undefined') global.nodeFeature()
, you can now check:I think it's useful, but it's just kind of deferring the problem, as you will still have to write platform-specific abstractions.
Yeah I guess that was my concern. If the different 'this' you're targeting can have radically different APIs, I would wonder why target them with a single globalThis instead of individually. I figured I was missing something..