关于数组

75 阅读1分钟

会改变原数组的方法

  • pop
  • push
  • shift
  • unshift
  • reverse
  • sort
  • splice
  • copyWithin
  • fill

不会改变原数组的方法

  • concat
  • join
  • slice
  • toString
  • toLocalString
  • indexOf
  • lastIndexOf
  • includes

数组的遍历迭代方法

  • forEach
  • every
  • some
  • filter
  • map
  • reduce
  • reduceRight
  • entries
  • find
  • findIndex
  • keys
  • values