我有这个对象数组
const unitsAndRates = [
{
propertyUnitType: "store",
propertyUnitRate: "20000",
numberOfUnit: 4
},
{
propertyUnitType: "duplex",
propertyUnitRate: "20000",
numberOfUnit: 3
}
];
我需要像上面生成的数组这样的东西。
const generated = [
{
propertyUnitType: "store1",
propertyUnitRate: "20000"
},
{
propertyUnitType: "store2",
propertyUnitRate: "20000"
},
{
propertyUnitType: "store3",
propertyUnitRate: "20000"
},
{
propertyUnitType: "store4",
propertyUnitRate: "20000"
},
{
propertyUnitType: "duplex1",
propertyUnitRate: "20000"
},
{
propertyUnitType: "duplex2",
propertyUnitRate: "20000"
},
{
propertyUnitType: "duplex3",
propertyUnitRate: "20000"
}
];
考虑到 ,我怎样才能生成上面的输出numberOfUnit?
慕后森
红颜莎娜
相关分类