In node.js, each module has its own top-level scope, but they all have access to the global object. Although, the use of global variables is frowned upon (bad for testability and various other reasons) :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
In node.js, each module has its own top-level scope, but they all have access to the
global
object. Although, the use of global variables is frowned upon (bad for testability and various other reasons) :)http://nodejs.org/api/globals.html#globals_global
I think the same would make sense for Espruino, each module having its own scope and the ability to access the global
global
object for shared state.