News for hackers. Stuff that matters.
Re:ECMAScript 2017 Language Specification by mhluongo on Tuesday July 11, 2017 @12:29PM (#14745518)
Spread syntax should cover linter issues

  Object.entries(obj).map(...).reduce((acc, [prop, value]) => ({...acc, prop:value}))
Re:ECMAScript 2017 Language Specification by Rotten194 on Tuesday July 11, 2017 @12:39PM (#14745620)
isn't that hideously inefficient? you're making a new object each iteration.
Re:ECMAScript 2017 Language Specification by Touche on Tuesday July 11, 2017 @12:58PM (#14745792)
But purity.
Re:ECMAScript 2017 Language Specification by djfm on Tuesday July 11, 2017 @01:42PM (#14746193)
it's very unlikely this is going to be the bottleneck in your application
Re:ECMAScript 2017 Language Specification by mintplant on Tuesday July 11, 2017 @02:53PM (#14746926)
I wouldn't be so quick to write that off as a performance concern. Creating tons of unnecessary objects is JavaScript's equivalent to programming without regard for cache locality at a lower level, due to the way the JITs work.
Re:ECMAScript 2017 Language Specification by Touche on Tuesday July 11, 2017 @03:11PM (#14747075)
It's very unlikely you'll get any benefit from doing it the inefficient way either. Does eslint not support "ignore this part" comments?
Re:ECMAScript 2017 Language Specification by Prefinem on Tuesday July 11, 2017 @06:22PM (#14748596)
Yes it does

// eslint-disable-line your-rule-to-ignore

Re:ECMAScript 2017 Language Specification by tracker1 on Tuesday July 11, 2017 @06:13PM (#14748543)
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.
Re:ECMAScript 2017 Language Specification by v413 on Wednesday July 12, 2017 @03:23AM (#14750752)
why not just use acc[prop] = value ?
Re:ECMAScript 2017 Language Specification by elmigranto on Wednesday July 12, 2017 @09:33AM (#14752354)
Assignment does not return `acc`.