展开

reduce

最后发布时间 : 2024-01-15 15:12:23 浏览量 :
const numbers = [1, 2, 3, 4, 5];

const sum = numbers.reduce((accumulator, currentValue) => accumulator + currentValue, 0);

console.log(sum); // 输出: 15
['./modules/about.ts', './modules/comp.ts'].reduce((list,key)=>{console.log(list);return [...list,key]},[])
    let respDict = await listByNames(["PRODUCT_TYPE", "SPECIES", "STRATEGY", "PRIMARY_SITE"])
    // const map = respDict.reduce((result, item) => {
    //     result.set(item.name, item.followDictDtoList.map((item) => { return { label: item.name, value: item.value } })  );
    //     return result;
    // }, new Map());
    const dictList = respDict.map((item) => { return item.followDictDtoList.map((item) => { return { label: item.name, value: item.value } })})
    console.log(dictList)
    schemas.value = jiaonangSchema(...dictList)
    columns.value = jiaonangColumn(...dictList)