# flat 平铺数组

const flatArr = (arr) => {
  return arr.reduce((pre, next) => {
    return pre.concat(Array.isArray(next) ? flatArr(next) : next);
  }, []);
};
Last Updated: 5/22/2022, 3:57:36 PM