对象动态添加属性名

let obj = {}; let index = 1; obj[`topic${index}`] = '话题内容';

 

posted @ 2022-04-22 15:25  干饭吧  阅读(35)  评论(0)    收藏  举报