> 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/concept/execution-context/lexical-environment/environment.md).

# \[\[Environment]]

[JS](/web/js.md) ⟩ [concepts](/web/browser/concepts.md) ⟩ [scope](/web/js/scope.md) ⟩ [lexical environment](/web/js/concept/execution-context/lexical-environment.md) ⟩ <mark style="color:purple;">`[[Environment]]`</mark>

{% hint style="success" %}
All [function](/web/js/val/func.md)s <mark style="color:orange;">**remember**</mark> the [lexical environment](/web/js/concept/execution-context/lexical-environment.md) <mark style="color:yellow;">**in which they were made**</mark>.&#x20;

* every <mark style="color:yellow;">**function**</mark> has the <mark style="color:yellow;">**hidden**</mark> [internal property](/web/js/val/obj/prop/internal.md) named <mark style="color:purple;">`[[Environment]]`</mark>, that <mark style="color:yellow;">**keeps**</mark> the <mark style="color:yellow;">**reference**</mark> to the <mark style="color:yellow;">**Lexical Environment**</mark> where the function was created.

📗 JS.info ⟩ [Lexical Environment](https://javascript.info/closure#step-4-returning-a-function)
{% endhint %}

{% tabs %}
{% tab title="🖥️ 影片" %}
{% embed url="<https://youtu.be/HuF-qYRnEAo>" %}
{% endtab %}

{% tab title="👥 相關" %}

* [internal property](/web/js/val/obj/prop/internal.md)
  {% endtab %}

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

* [ ] JS.info ⟩ [Lexical Environment](https://javascript.info/closure#lexical-environment) ⭐️
  {% endtab %}
  {% endtabs %}
