Talking about js statements similar to (function () {}). call ()

Source: Internet
Author: User

Talking about js statements similar to (function () {}). call ()

This article mainly introduces the js statements similar to (function () {}). call (). For more information, see

Study the automatic login process of Sina Weibo, which involves its encryption algorithm script, which contains the following code:

(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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.