Home  >  Article  >  Web Front-end  >  array.prototype.silce.call understanding analysis_javascript skills

array.prototype.silce.call understanding analysis_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:29:571308browse

Array.prototype.slice.call(thisArg[, arg1[, arg2[, ...]]])
Member introduction:

Array Array object

prototype [property]
is a 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 For details, please see here

slice [Function]
Use the original array object to intercept the specified part and return a new Array object. For details, please see here

call [Function] <font face="NSimsun"><code><font face="NSimsun"><b>call(</b>[<i>thisObj</i>[,<i>arg1</i>[<i>, arg2</i>[<i>,   </i>[<i>,.argN</i>]]]]]<b>)</b></font>call(

[thisObj[,arg1[ , arg2[, [,.argN]]]]]

) Call a method of an object to replace the current object with another object. For details, please see here

.

After understanding the above one by one, it will be easy to understand

Array.prototype.slice.call(thisobj,start,end)
It is to cut thisobj object into a new array through the call method


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn