call apply bind

Each function contains two non-inherited methods call() apply()

Purpose : To call a function in a specific scope, which is actually equal to setting the value of the this object in the function body


  1. apply call

The apply method takes two arguments : an array of scoped arguments in which to run the function

The second parameter can be an instance of Array or an arguments object

The first parameter is null undefined which points to window global 
(strict mode points to null undefined)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324690118&siteId=291194637