Responded to @kasparsd:
Computed Property Names 📜 ES6 (2015)
const key = 'foo';
const obj = { [key]: 123 };
Turns variable value into a property key. Syntax sugar for obj[key] = 123.
Responded to @kasparsd:
Computed Property Names 📜 ES6 (2015)
const key = 'foo';
const obj = { [key]: 123 };
Turns variable value into a property key. Syntax sugar for obj[key] = 123.