When a property key arrives as a variable, writing `{ name: value }` creates a property literally named `name`. A computed property name evaluates an expression in square brackets, so `{ [name]: value }` uses the value stored in `name` as the key. section 12.3
function setValue(name, value) {
stateManager.update({
[name]: value
});
}
const [name, value] = otherLibrary.operate();
setValue(name, value);
Use a computed key to create the update object directly, without first making an empty object and assigning its property. section 12.3
The bracket syntax works like assigning a dynamic property after an object is created. In the color example, `[property]` creates `color`; `eyes.property` looks for a separate property literally named `property`. section 12.3
const property = 'color';
const eyes = { [property]: 'green' };
console.log(eyes.property, eyes.color);
Compare dot access with the computed key: the object has a `color` property, not a `property` property. section 12.3
