Concatenating an array of arrays in Coffeescript

后端 未结 5 726

I\'m trying to find an elegant way in Coffeescript to merge an array of arrays, so that [[1,2,3],[4,5,6],[7,8,9]] ==> [1,2,3,4,5,6,7,8,9].

As you might imagine, I need t

5条回答
  •  旧巷少年郎
    2021-02-04 00:57

    Why not try using Lodash?

    _.flatten([1,2,3], [4,5,6]) => [1,2,3,4,5,6]
    

    https://lodash.com/docs#flatten

提交回复
热议问题