.
to access nested properties and []
to access a specific item in an array. items[0].name
. We use [0]
to access the first item because lists are zero-based, then we use .name
to access the name property value in the first item.price
property of the first item in the items
array. In the second example, we're giving the path to the more deeply nested customer street address.