Aug 22, 2017 · 1 min read
I got to use computed properties for an object the other day. At first I thought it looked weird until I realized:
const a = ‘foo’;
const b = {[a]: ‘bar’};
is just short for:
const a = ‘foo’;
const b = {};
b[a] = ‘bar’;
It changed everything.