Flatten Javascript array

前端 未结 5 1232
悲&欢浪女
悲&欢浪女 2021-01-29 12:36

I have an array of objects like this:

let list = [
  {
    \'items\': [
      \'item 1\',
      \'item 2\'
    ]
  },
  {
    \'items\': [
      \'item 3\'
    ]         


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-29 13:15

    https://lodash.com/docs/4.17.14#flatten

    And

    https://lodash.com/docs/4.17.14#flattenDeep

    Look like they're exactly what you need.

提交回复
热议问题