let attrName = 'id';
let newObj = {
[attrName]: '123'
};
等价于
let attrName = 'id';
let newObj = {};
newObj[attrName] = '123';
let attrName = 'id';
let newObj = {
[attrName]: '123'
};
等价于
let attrName = 'id';
let newObj = {};
newObj[attrName] = '123';