Helma logo
helma.org » Home > Stories > global

global

The global object contains a reference to itself, which allows you to easily check for the existence of global objects, even in code that does not run in the global scope.

Example:

if (!global.foo) {
    global.foo = {};
}
foo.bar = function() {}


... comment


Page last modified on 2006-03-21 10:59 by czv

 
ars2004, Sunday, 1. October 2006, 22:18
if (!global.foo) {
if (!global.foo) {
global.foo = {};
}
foo.bar = function() {}

... link  


... comment