ES6 added support for computed property names in objects, allowing the object key to be determined dynamically:
const variable = 'foo'; const obj = { [variable]: 'bar', } // obj = { foo: 'baz' }
[[js]]