I'm from Ruby language so sorry for noob question. I've got this response from API:
[{:id=>"61b79d02a0f6af001374744e",
:name=>"Waffle Crewneck",
:code=>"FW22KS000",
:result=>{"status"=>"Success", "message"=>"FW22KS000 - Synced"},
:last_sync_at=>Wed, 18 May 2022 23:51:45.195079000 UTC +00:00},{:id=>"611ea9a7392ab50013cf4713", :name=>"2-Tone Hoodie", :code=>"SS22CH013", :result=>nil, :last_sync_at=>nil},]
Which I want to display inside of the table:
<tr v-for="product in fetchedProductSyncStatus" :key="product">
<td class="text-bold">
{{ product.result.status }}
</td>
<td class="text-bold">
{{ product.result.message }}
</td>
<td class="text-bold">
{{ product.last_sync_at }}
</tr>
Because in second array element product.result == nil I've got an error:
TypeError: Cannot read properties of null (reading 'status')
Looking for something similar to Ruby's product.result&.message. How to avoid such error in Vue and display empty string instead?