> 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/val/func/forward.md).

# function forwarding

🚧 under construction -> function context

[JS](/web/js.md) ⟩ [value](/web/js/val.md) ⟩ [function](/web/js/val/func.md) ⟩ forwarding

{% hint style="success" %}
Passing <mark style="color:yellow;">**all**</mark> [**arguments**](/web/js/val/func/argument.md) along with the <mark style="color:yellow;">**context**</mark> to another function is called call <mark style="color:purple;">**forwarding**</mark>.

```javascript
function f() {
    // forward call to g()
    return g.apply(this, arguments);
}
```

{% endhint %}

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

* [ ] js.info ⟩[ func.apply](https://javascript.info/call-apply-decorators#func-apply) ⭐️&#x20;
  {% endtab %}

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

* [Function.prototype.apply()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply)
  {% endtab %}
  {% endtabs %}
