如何向小程序对象里面动态的添加键值
动态键值是指的赋值嘛?
var test = { } test['active']=value
let keyX = 'key',object={}
object[keyX] ='value'
console.log(object)
如果键值也是动态的:
let keyX = ‘key’, valueX = ‘value’
object[keyX] = valueX
直接赋值:
object1.keyX = ‘valueX’