Skip to content

Array

构造器

js
const arr = new Array();

静态方法

  • isArray
  • from
js
const set = new Set();
Array.isArray(set); //returns false
Array.from(set); //returns []

实例属性

  • length
js
const arr = [];
arr.length; //returns 0

实例方法

返回的不是数组

  • at
  • forEach
  • includes
  • push、pop
  • shift、unshift
  • find、findLast
  • findIndex、findLastIndex
  • indexOf、lastIndexOf
  • some、every
  • reduce、reduceRight
  • join
  • entries

返回新数组

  • splice
  • slice
  • filter
  • map
  • from
  • flat、flatMap
  • concat

返回原数组

  • sort
  • reverse
  • copyWithin

案例

at

some、every

Coded by Yang_Lee