title: How to Reassign Function Parameters
body: <p>I understand that it can be bad to <a href="https://eslint.org/docs/rules/no-param-reassign" rel="nofollow noreferrer">reassign function parameters</a> but I don't quite see how it would be done in this case? I'm using a forEach loop to cycle through the todo list array (which is on an object) <code>todos</code> and alter the <code>completed</code> property and I don't see how I can not reuse <code>eachTodo</code> </p>
  
  <p>How would this be rewritten so that it has the same functionality but doesn't reuse <code>eachTodo</code>?</p>
  
  <pre><code>    this.todos.forEach((eachTodo) =&gt; {
        if (completedTodos === totalTodos) {
          eachTodo.completed = false;
        } else {
          eachTodo.completed = true;
        }
      });
  </code></pre>
  
  <p>Full project <a href="https://glitch.com/edit/#!/false-aquarius?path=public/client.js:34:4" rel="nofollow noreferrer">here</a></p>