[js] 函數 call()方法和 apply()方法

js 函數 call()方法和 apply()方法 咱們能夠將call()和apply()看作是某個對象的方法,經過調用方法的形式來間接調用函數。 以下代碼,使用call()方法來調用一個對象的 Object.prototype.toString 方法,用以輸出對象的類css Object.prototype.toString.apply({}) // "[object Object]" call
相關文章
相關標籤/搜索