2-9 Global environment and Global object

  • Global objects(Ex: window, on browser) and “this” is created by javascript engine
  • At globle level, ‘this’ is equal to ‘window’ inside browser
  • the global (values and functions) are attached to global objects

1
2
3
4
5
6

a = 'hello world';
b = function(){};

console.log(window.a);
console.log(window.b);