Global

A Global is a Script that is attached to the global scope. (window) A Global allows to create and access global variables.

Example

// Create a new Global
class MyGlobal extends Global{
  constructor(){
     super();
    this.myVariable = 0;
}
}
new MyGlobal();

// Access the global variable
console.log(window.MyGlobal.myVariable);

Extends

  • Script