Recent | Popular
#object #literals
function getKey(k) { return `a key named ${k}`; } // bad const obj = { id: 5, name: 'San Francisco', }; obj[getKey('enabled')] = true; // good const obj = { id: 5, name: 'San Francisco', [getKey('enabled')]: true, };
Thu Aug 19 2021 15:53:29 GMT+0000 (Coordinated Universal Time) https://github.com/airbnb/javascript