数组的方法

36 阅读1分钟

修改原数组

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

不修改原数组

  • forEach
  • map
  • filter
  • reduce
  • reduceRight
  • every
  • some
  • join
  • includes
  • indexOf
  • lastIndexOf
  • find
  • findIndex
  • findLast
  • findLastIndex
  • flat
  • flatMap
  • with
  • at
  • toSplice
  • toSorted
  • toReversed
  • toString
  • toLocaleString
  • entries
  • keys
  • values
  • Array.from
  • Array.fromAsync
  • Array.of
  • Array.isArray