title: How to handle eslint no-param-reassign rule in Array.prototype.reduce() functions
body: <p>I've recently added the eslint rule <a href="http://eslint.org/docs/rules/no-param-reassign" rel="noreferrer"><code>no-param-reassign</code></a>.</p>
  
  <p>However, when I use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce" rel="noreferrer"><code>reduce</code></a> to build out an object (empty object as <code>initialValue</code>), I find myself needing to modify the <code>accumulator</code> (first arg of callback function) on each callback iteration, which causes a <code>no-param-reassign</code> linter complaint (as one would expect it would).</p>
  
  <pre><code>const newObject = ['a', 'b', 'c'].reduce((result, item, index) =&gt; {
    result[item] = index; // &lt;-- causes the no-param-reassign complaint
    return result;
  }, {});
  </code></pre>
  
  <p>Is there a better way to build out an object with <code>reduce</code> that doesn't modify the <code>accumulator</code> argument?  </p>
  
  <p>Or should I simply disable the linting rule for that line in my <code>reduce</code> callback functions?</p>