In many frameworks, I encountered this method, but I didn't study it for a while. As long as I was asked some time ago, I was helpless. Therefore, we need to keep an accurate understanding of our study.
Array. Prototype. Slice. Call (thisarg [, arg1 [, arg2 [,...])
Member introduction:
ArrayArray object
Prototype[Property]
Is the property of an object in Javascript. It is used to return the prototype reference of the object. You can dynamically add methods and attributes to this object, such as array, object, or user-defined object. For details, seeHere
Slice[Function]
Use the original array object to intercept the specified part and return a newArrayObject. For details, seeHere
Call[Function]Call ([Thisobj[,Arg1[, Arg2[,[,. Argn])
Call a method of one object to replace the current object with another object. For details, seeHere.
After the above is understood one by one, we can understand it.
Array. Prototype. Slice. Call (thisobj, start, end)The thisobj object is partitioned into a new array through the call method.
As follows:
<! Doctype HTML> <br/> <HTML xmlns = "http://www.w3.org/1999/xhtml"> <br/> <pead> <br/> <meta http-equiv = "Content-Type" content =" text/html; charset = UTF-8 "/> <br/> <title> call </title> <br/> <SCRIPT type =" text/JavaScript "> <br/> function FN () {<br/> A = array. prototype. slice. call (arguments, 2); <br/> alert (a); <br/>}< br/> FN (1, 2, 3, 5 ); <br/> </SCRIPT> <br/> </pead> <br/> <body> <br/> </ptml>
RunCode