Log in Sign up
1 Matching Annotations
  1. Nov 2020
  2. stackoverflow.com stackoverflow.com
    What is the 'global' object in NodeJS
    1
    1. TylerRick 25 Nov 2020
      in Public
      If you want a reference to the global object that works in any context, you can read this from a directly-called function. const global = (function() {return this})();. This evaluates to window in the browser, self in a service worker and global in nodejs.
      javascript: global object javascript: server environment vs. browser environment workaround universal JavaScript javascript: how to make it work in all runtime environments
    Visit annotations in context

    Tags

    • workaround
    • javascript: global object
    • universal JavaScript
    • javascript: how to make it work in all runtime environments
    • javascript: server environment vs. browser environment

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/43627622/what-is-the-global-object-in-nodejs
Share:
Group. Only group members will be able to view this annotation.
Only me. No one else will be able to view this annotation.
Hypothes.is
  • About
  • Blog
  • Bioscience
  • Education
  • Jobs
  • Help
  • Contact
  • Terms of Service
  • Privacy Policy