js对象动态的添加属性

var obj = {}

var key = 'name'

var value = '张三'

obj[key] = value

posted @ 2020-07-23 14:58  pyx204  阅读(237)  评论(0)    收藏  举报