js array method

Array methods include array prototype methods and methods inherited from object objects. Here we only introduce array prototype methods. Array prototype methods mainly include the following:

join()
push() and pop()
shift() and unshift()
sort()
reverse()
concat()
slice()
splice()
indexOf() and lastIndexOf() (new in ES5)
forEach() (new in ES5) added)
map() (new in ES5)
filter() (new in ES5)
every() (new in ES5)
some() (new in ES5)
reduce() and reduceRight() (new in ES5)

New method browser support for ES5:

Opera 11+ 
Firefox 3.6+ 
Safari 5+ 
Chrome 8+ 
Internet Explorer 9+

For supported browser versions, this can be achieved via the Array prototype extension. The basic functions of each method are described in detail below.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325273269&siteId=291194637