JavaScript Global Objects Explained Simply
A Global Object is an object that always exists in the global scope. In a browser, the Global Object is the 'Window' and in Node.js the object is Global.
const rounded = Math.round(4.6);
const encoded = JSON.stringify({ score: rounded });
console.log(rounded);
console.log(encoded);
console.log(globalThis.Math === Math);
console.log(globalThis.JSON === JSON); AI panel
Ask AI to clarify the parts you don’t fully understand, or go more in depth with MDN documentation.