上代码:
var key1 = 'abc';var data1 = 'DDDDDDDDDDD';var key2 = 'def';var data2 = 'GGGGGGGGGGG';var rst = { key1: data1, key2: data2 };console.log(rst);
结果是:
rst = { key1: DDDDDDDDDDD, key2: GGGGGGGGGGG }
我想得到这样的结果
{ rst = { abc: DDDDDDDDDDD, def: GGGGGGGGGGG}
请问该如何实现?
明月笑刀无情
相关分类