โglobal let shadows global object property
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
JS โฉ scope โฉ global โฉ variable โฉ let โฉ shadows global object property
global let shadows global object propertyโ
// in "browser" environment, globalThis === window
const { log } = console;
// โญ๏ธ "global let" shadows "global object property"
globalThis.prop = 42; // global object property
let prop = 'hi'; // global let
log(prop); // 'hi' // shadows global object property