Example JavaScript Global Scope

by rsschouwenaar

JavaScript

// Global scope
var thisVariable = 'Google';
var thisSecondVar = 250;

(function() {
    // Local scope
    console.log('thisVariable: ', thisVariable);
    console.log('thisSecondVar: ', thisSecondVar);
})();