# global let shadows global object property

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

{% hint style="warning" %}
[](<> "mention") <mark style="color:red;">**shadows**</mark> [prop](../../object/prop "mention"):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-and-closures-v.2](../../../../../master/ref/book/you-dont-know-js-series-v.2/ydkjs-scope-and-closures-v.2 "mention") ⟩ Ch. 4:&#x20;
{% endtab %}
{% endtabs %}
