You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Yes, it's probably an oversight really. In the browser you've got window, and we should really have something similar. The 'root' is of type Hardware, so really we should have a hardware variable that can be accessed.

    However, you can create a global variable just like:

    function foo() {
      global = "Hello";
      var local = "World";
    }
    

    It works even for objects too - so you've actually got to be careful about using var in functions of you end up creating a lot of global stuff :)

About

Avatar for Gordon @Gordon started