1.3.apply, call

  • 1.call

    • 語法:

      call([thisObj[, arg1[, arg2[,  [, argN]]]]])
    • 參數:

      • thisObj: 選擇項。為目前的使用物件。

      • arg1, arg2, , argN: 選擇項。要傳遞給方法的引數清單。

    • 作用:

      • call 方法是用來代替另一個物件呼叫方法。此方法可讓您將函式的 this 物件從原始內容變成由 thisObj 所指定的新物件。

        如果未提供 thisObj 的話,將使用 global 物件做為 thisObj。

    • example code:

Last updated