# 1.3.apply, call

* 1.call
  * 語法:

    ```
    call([thisObj[, arg1[, arg2[,  [, argN]]]]])
    ```
  * 參數:
    * thisObj: 選擇項。為目前的使用物件。
    * arg1, arg2, , argN: 選擇項。要傳遞給方法的引數清單。
  * 作用:
    * call 方法是用來代替另一個物件呼叫方法。此方法可讓您將函式的 this 物件從原始內容變成由 thisObj 所指定的新物件。

      如果未提供 thisObj 的話，將使用 global 物件做為 thisObj。
  * example code:     &#x20;
    * <http://codepen.io/JenHsuan/pen/qrmYxg?editors=1012>
    * 結果 &#x20;
      * 1.一般呼叫時, this指向的是全域物件, window
      * 2.當用call傳入參數時, 會將this指向第一個參數

![](https://3195929128-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G8GO2MkGtHfarAf%2F-M4M0IHoyFvfGKjf7P-T%2F-M4M0M2WtUA_zfoJBAjz%2F0d5ddfb1-6918-4e51-8132-446be42bf6fe.png?generation=1586302920104326\&alt=media)
