# \[\[Environment]]

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

{% hint style="success" %}
All [func](https://lochiwei.gitbook.io/web/js/val/func "mention")s <mark style="color:orange;">**remember**</mark> the [](https://lochiwei.gitbook.io/web/js/concept/execution-context/lexical-environment "mention") <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](https://lochiwei.gitbook.io/web/js/val/obj/prop/internal "mention") 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](https://lochiwei.gitbook.io/web/js/val/obj/prop/internal "mention")
  {% endtab %}

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

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