<分区>
假设我有以下数组:
const arr = [ 'a,b,c', 'd,e,f', 'g,h,i' ];
我想去
[ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i' ]
我目前正在使用 reduce https://jsbin.com/xejedexada/edit?js,console
arr.reduce((a,c) => (typeof a == 'object' ? a : a.split(',')).concat(c.split(',')));
但我想知道是否有更好的方法来做到这一点。