Hacker News new | ask | show | jobs
by tracker1 3263 days ago
In those cases, I usually use

    Object.assign(acc, { [prop]:value })
While not sure if `[prop]` is better or worse than not creating a new interstitial object.
1 comments

why not just use acc[prop] = value ?
Assignment does not return `acc`.