This article mainly introduces functions (){}). for details about the call () js statement and related information, refer to the study of Sina Weibo's automatic login process, which involves its encryption algorithm script, the code is as follows:
(Function () {...}). call (name)
The red one .... is the internal implementation of the function. name is the name of an object. this type of js has never been seen before (forgive me for having little knowledge about js ). then Baidu has the following meanings:
The purpose of. call (name) is to use name as this in the domain where the previous function is located. that is to say, this in the function is equivalent to referencing name.
The actual meaning of this code can be considered as: the specific implementation of the function modifies the variable name, or, more simply, the implementation of the function is the specific implementation of the variable name, in a sense, it is equivalent:
Var name = function (){...}
The above is all the content of this article. I hope you will like it.