I\'ve recently added the eslint rule no-param-reassign.
However, when I use reduce to build out an object (empty object as initialValue), I find myself need
initialValue
One solution would be to leverage the object spread operator
const newObject = ['a', 'b', 'c'].reduce((result, item, index) => ({ ...result, [item]: index, }), {});