一直在用lodash 这个框架,最近踩了一个坑
reverse 这个函数是mutable的 ,后边去查了文档

Note: This method mutates array and is based on Array#reverse.

果然是没有看清文档, 于是和一个精通前端的人请教了一下:

lodash 有几个函数是mutable,大部分是immutable的

于是整理了一下, 下边的函数都是mutable的
fill,pull,pullAll ,pullAllBy,pullAllWith ,pullAt,remove ,reverse ,assign ,assignIn,assignInWith ,assignWith ,defaults ,defaultsDeep ,merge ,mergeWith ,set ,setWith ,unset ,update ,updateWith ,prototype.reverse()

相关文章:

  • 2021-08-03
  • 2022-03-02
  • 2021-10-09
  • 2022-02-28
  • 2021-05-27
  • 2021-07-29
  • 2021-10-04
  • 2021-06-07
猜你喜欢
  • 2021-07-04
  • 2021-12-04
  • 2021-07-22
  • 2021-06-20
  • 2021-07-30
  • 2021-05-24
  • 2021-08-08
相关资源
相似解决方案