> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/js/scope/global/variable/let/shadows-global-object-property.md).

# global let shadows global object property

[JS](/web/js.md) ⟩ [scope](/web/js/scope.md) ⟩ [global](/web/js/scope/global.md) ⟩ [variable](/web/js/scope/global/variable.md) ⟩ [let](/web/js/scope/global/variable/let.md) ⟩ shadows global object property

{% hint style="warning" %}
[global let](/web/js/scope/global/variable/let.md) <mark style="color:red;">**shadows**</mark> [global object property](/web/js/scope/global/object/prop.md):exclamation: &#x20;
{% endhint %}

{% tabs %}
{% tab title="💈範例" %}

* replit：[global let shadows global object property](https://replit.com/@pegasusroe/global-let-shadows-global-object-property#script.js)

```javascript
// 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
log(globalThis.prop);   // 42     // global object property remains untouched
```

{% endtab %}

{% tab title="📗 參考" %}

* [ ] [YDKJS: Scope & Closures (v.2)](/web/master/ref/book/you-dont-know-js-series-v.2/ydkjs-scope-and-closures-v.2.md) ⟩ Ch. 4:&#x20;
  {% endtab %}
  {% endtabs %}
