let obj = {}
for (let index = 0; index < 3; index++) {
    obj['name'+index] = index
    
}
console.log(obj);// { name0: 0, name1: 1, name2: 2 }
Logo

前往低代码交流专区

更多推荐