数组对象处理

 const flatObject = Object.keys({ ...list }).reduce((result: any, key) => {
            const innerObj = { ...list }[key];
            Object.keys(innerObj).forEach((innerKey) => {
              result[innerKey] = innerObj[innerKey];
            });
            return result;
          }, {});

  

posted @ 2023-09-05 09:34  zjxgdq  阅读(3)  评论(0编辑  收藏  举报