sanjar-notes / web_dev_fundamentals

The basics - HTML, CSS, Javascript and more
https://sanjar-notes.github.io/web_dev_fundamentals/
3 stars 0 forks source link

JS has global (in any case non-nested) symbol table? #72

Open sanjarcode opened 1 year ago

sanjarcode commented 1 year ago

Already know this (and it also happens in Python, AFAIR). But didn't think about it rigorously.

Example:

const x = { a: 1 };
let { a: xx } = x;

xx = 99; // x remains unchanged

Is this the consequence of having a global (essentially non-nested, even if not global) symbol table, by the language?