🚧 施工中
JS ⟩ concepts ⟩ environment
JavaScript code can be run:
in browser (client code)
in web worker
in Node.js (server code)
environments
browser (client code)
Node.js (server code)
web worker
JS engine
global object in each environment:
browser: window (a Window object)
Window
web worker: self (a WorkerGlobalScope object)
WorkerGlobalScope
Node.js: global (an object called global)
global
every environment exposes some of its own built-ins into the global scope:
browser:console, DOM(including window), timers, web API
console
web worker:??? (anything else?)
Node.js:???
YDKJS: Scope & Closures (v.2) ⟩ Chapter 4: Around the Global Scope
Global object
timers
Last updated 2 years ago