Is it possible to set javascript objects dynamically?(是否可以动态设置javascript对象?)
I your create objects this way:(我以这种方式创建对象:)
let data = {a: {b: 'value'}};
but I need to create it this way:(但是我需要这样创建它:)
let data ['a'] ['b'] = 'value';
Object creation will happen within a loop dynamically.(对象创建将在循环内动态发生。) That's why I need the second way.(这就是为什么我需要第二种方式。)
ask by Jobsdev translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…