# running execution context

[JS](https://lochiwei.gitbook.io/web/js) ⟩ [concept](https://lochiwei.gitbook.io/web/browser/concepts) ⟩ [execution context](https://lochiwei.gitbook.io/web/js/concept/execution-context) ⟩ running execution context

{% hint style="success" %} <mark style="color:yellow;">**At any point in time**</mark>, there is <mark style="color:red;">**at most**</mark>**&#x20;**<mark style="color:yellow;">**one**</mark> [](https://lochiwei.gitbook.io/web/js/concept/execution-context "mention") that is actually <mark style="color:yellow;">**executing**</mark> code. This is known as the <mark style="color:purple;">**running execution context**</mark>.

📘 [js-spec](https://lochiwei.gitbook.io/web/master/ref/js-spec "mention") ⟩ 8.2 [Execution Contexts](https://262.ecma-international.org/6.0/#sec-execution-contexts)
{% endhint %}

{% tabs %}
{% tab title="⭐️ 重點" %}
{% hint style="success" %}
A <mark style="color:yellow;">**stack**</mark> (call stack) is used to <mark style="color:yellow;">**track**</mark> [](https://lochiwei.gitbook.io/web/js/concept/execution-context "mention")(s). The <mark style="color:purple;">**running execution context**</mark> is always the <mark style="color:yellow;">**top**</mark> element of this stack.
{% endhint %}
{% endtab %}

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

* [lexical-environment](https://lochiwei.gitbook.io/web/js/concept/execution-context/lexical-environment "mention") is <mark style="color:yellow;">**part**</mark> of <mark style="color:purple;">**execution context**</mark>.
  {% endtab %}

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

* [ ] Anil ⟩ [Scope, Lexical Environment and Scope Chain in JavaScript](https://medium.com/@anilakgunes/scope-lexical-environment-and-scope-chain-in-javascript-559aadb7dca8) ⭐️
  {% endtab %}

{% tab title="📘 手冊" %}

* [ ] [js-spec](https://lochiwei.gitbook.io/web/master/ref/js-spec "mention") ⟩&#x20;
  * [ ] [Execution Contexts](https://262.ecma-international.org/6.0/#sec-execution-contexts)
  * [ ] [running execution context](https://tc39.es/ecma262/#running-execution-context)
    {% endtab %}

{% tab title="🚧" %}

* [ ] call stack
* [x] running execution context
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lochiwei.gitbook.io/web/js/concept/execution-context/running-execution-context.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
