What does const myObject = { ...object1, ...object2 } evaluate to in JS? : <p>I inherited some code in a React Native codebase and was just curious as to what this syntax means. Can't seem to find a good answer by googling but I have console logged it seems like: </p>

<pre><code>   const myObject = object2 ? ojbect2 : object1
</code></pre>

<p>Is similar to: </p>

<pre><code>   const myObject = { ...object1, ...object2}
</code></pre>
