Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
tracker1
· 9y ago · 0 comments
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.
Comments
[–]
v413
9y ago
why not just use acc[prop] = value ?
[–]
elmigranto
9y ago
Assignment does not return `acc`.