tag: 'javascript: global object'

Narrow your search:

    Log in Sign up
    2 Matching Annotations
    1. Nov 2020
    2. stackoverflow.com stackoverflow.com
      What is the 'global' object in NodeJS
      2
      1. TylerRick 26 Nov 2020
        in Public
        this in NodeJS global scope is the current module.exports object, not the global object
        node.js javascript: global object
      2. 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

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

      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