Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
A global reference to the global object... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
global // the global object |
Parameters
Not applicable.
Return value
The global 'global' property is a reference to the global object.
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
var bar = "kipper"; function foo() { var bar = "halibut"; console(bar); // halibut console(global.bar); // kipper } |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
(function(){ // https://warzone.atlassian.net/wiki/display/jsapi/Code+sandboxing var eventStartLevel; // oops, now we can't define global eventStartLevel from in here :( // oh, yes we can! :) global.eventStartLevel = function() { // code } })(); |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
This feature requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
GlobalsTopics:
|