知识点:JavaScript 字符串、数组方法对比

字符串方法(String 对象方法)

共同方法:

  • concat()indexOf()lastIndexOf()slice()toString()valueOf()

不同方法:

  • charAt()charCodeAt()fromCharCode()
  • localeCompare()
  • match()replace()
  • search()
  • split()
  • substr()substring()
  • toLocaleLowerCase()toLocaleUpperCase()toLowerCase()toUpperCase()
  • trim()

数组方法(Array对象属性)

共同方法:

  • concat()indexOf()lastIndexOf()slice()toString()valueOf()

不同方法:

  • copyWithin()
  • fill()
  • filter()
  • find()findIndex()
  • every()forEach()map()
  • join()
  • pop()push()shift()unshift()
  • reduce()reduceRight()
  • reverse()
  • some()
  • sort()
  • splice()
原文地址:https://www.cnblogs.com/cq7216/p/6663566.html