title: VueJS - why do forEach / push and .filter return different results?
body: <p>This is more of a plain JavaScript question I guess, but why does looping through an object with a forEach loop and pushing matching items to your result array return a different result that using <code>.filter</code>?</p>
  <p>Aren't they basically the same thing?</p>
  <pre><code>updated() {
      this.locations.forEach((loc) =&gt; {
        if (loc.fields.UserRolesPermitted.includes(this.airtableView)) {
          this.loopedLocations.push(loc);
        }
      });
      console.log(this.loopedLocations); // returns correct object, i.e. has length
  
      this.filteredLocations = this.locations.filter((loc) =&gt; {
        loc.fields.UserRolesPermitted.includes(this.airtableView);
      });
      console.log(this.filteredLocations); // returns empty [__ob__: Observer]
    }
  </code></pre>