Filter through an array in javascript
<p>I have one array with a list of all cars, as follows :</p>

<pre><code>const allCars = [
       {id: 1, listID: 1, name: "Car 1", chassis: "000000000"},
       {id: 2, listID: 2, name: "Car 2", chassis: "111111111"},
       {id: 3, listID: 1, name: "Car 3", chassis: "222222222"},
       {id: 4, listID: 1, name: "Car 4", chassis: "333333333"}
    ];
</code></pre>

<p>and I have some of those cars in the shopping cart, as follows :</p>

<pre><code>const carsInCart = [
           {carID: 1, listID: 1, offer: 488},
           {carID: 2, listID: 2, offer: 786},
        ]
</code></pre>

<p>Is there any way to filter throught allCars and return only those which are in carsInCart, and return only chassis from allCars and offer from carsInCart?</p>

<p>Thus, what I want is something like this :</p>

<pre><code>const result = [
   {chassis: 000000000, offer: 488},
   {chassis: 111111111, offer: 786}
]
</code></pre>