Array.prototype.silce.call Comprehension Analysis _javascript Skills

Source: Internet
Author: User

Array.prototype.slice.call (thisarg[, arg1[, arg2[, ...)]]
Member Introduction:

Array Arrays Object

prototype [Property]
is a property of an object in JavaScript that returns a prototype reference to an object that can be dynamically added to this method and attribute, such as Array,object, or a user-defined object, for details please see here

Slice [Function]
With the original array object, intercept the specified part to return a new array object, see here for details

Call [Function]call([thisObj[,arg1[, arg2[,   [,.argN]]]]])

Call one of the object's methods and replace the current object with another object, see here for details .

After each of the above understanding, and then a good understanding of

Array.prototype.slice.call (thisobj,start,end) is the Thisobj object is cut into a new array by the Call method

As follows:

<! DOCTYPE html> <ptml xmlns= "http://www.w3.org/1999/xhtml" > <pead> <meta http-equiv= "Content-type" Content= "text/html; charset=gb2312 "/> <title>call</title> <script type=" Text/javascript "> function fn () {a = Array. Prototype.slice.call (arguments,2); alert (a); FN (1,2,3,5); </script> </pead> <body> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

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.