title: Modifying an array element using filter method
body: <p>I'm trying to modify an element in a list in Vue.js using <code>.filter()</code> method. The new element comes from Pusher. I'm listening for the event and trying to update the element like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>users.filter((obj) =&gt; {
      Echo.private(`user.${obj.id}`).listen('.userupdated', (e) =&gt; {
          return obj = e.user; // or return e.user; also doesn't work
      });
  });
  </code></pre>
  
  <p>This doesn't work. Both objects are identical in terms of their structure, but the new object coming through Pusher contains the updated information.</p>
  
  <p>On the other hand, when I try to modify a property, it works:</p>
  
  <pre class="lang-js prettyprint-override"><code>users.filter((obj) =&gt; {
      Echo.private(`user.${obj.id}`).listen('.userupdated', (e) =&gt; {
          return obj.name = e.user.name;
      });
  });
  </code></pre>
  
  <p>What am I doing wrong? Is replacing an entire element like this isn't allowed?</p>