# context

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

{% hint style="success" %}
([this](https://lochiwei.gitbook.io/web/js/concept/execution-context/this "mention")) <mark style="color:yellow;">**object**</mark> to which a [func](https://lochiwei.gitbook.io/web/js/val/func "mention") belongs.
{% endhint %}

{% tabs %}
{% tab title="🔴 主題" %}

* <mark style="color:yellow;">**key concepts**</mark>
  * [this](https://lochiwei.gitbook.io/web/js/concept/execution-context/this "mention") - <mark style="color:yellow;">**property**</mark> of an **execution context**.
  * [context-vs.-scope](https://lochiwei.gitbook.io/web/js/scope/context-vs.-scope "mention")
* <mark style="color:yellow;">**different contexts**</mark>
  * [global-context](https://lochiwei.gitbook.io/web/js/concept/context/global-context "mention")
  * [class-body](https://lochiwei.gitbook.io/web/js/concept/context/class-body "mention") - class body has its own [this](https://lochiwei.gitbook.io/web/js/concept/execution-context/this "mention") context.
    {% endtab %}

{% tab title="⭐️ 重點" %}
{% hint style="warning" %} <mark style="color:yellow;">**context vs. scope**</mark>

* <mark style="color:purple;">**scope**</mark>：<mark style="color:yellow;">**visibility**</mark> of [variable](https://lochiwei.gitbook.io/web/js/variable "mention").&#x20;
* <mark style="color:purple;">**context**</mark>：([this](https://lochiwei.gitbook.io/web/js/concept/execution-context/this "mention")) <mark style="color:yellow;">**object**</mark> to which a [func](https://lochiwei.gitbook.io/web/js/val/func "mention") refers.
  {% endhint %}
  {% endtab %}

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

* [x] Kevin Chisholm ⟩ [What is the Difference Between Scope and Context in JavaScript?](https://blog.kevinchisholm.com/javascript/difference-between-scope-and-context/)
  {% endtab %}

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

* [ ] [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this) ⟩ [global](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this#global_context) / function / eval context
  {% endtab %}

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

{% endtab %}
{% endtabs %}
