All global variables are stored on the window object in a browser. Alternatively, they are stored on the global or GLOBAL object in Node.js. You can enumerate that object's keys instead, but keep in mind that it will contain much, much more than user-defined globals.