WanderLust project help

Bit confused - What does the item ==> item.venue bit actually do?

Many thanks!

Arrow function expressions is the term to look up. Paired with map, it will iterate and do an action. I think in the example you put it iterates through the items list and returns their .venue

items = ["banana", "mango", "pear"]
items.map(fruit => console.log(`I ate a ${fruit}`))

// I ate a banana
// I ate a mango
// I ate a pear

Yep you’re spot on. I realised when I completed the task and understood it a bit better that essentially it just took the item object and made it equal to the data underneath its venue property (i.e. enabling us to forget the rest of the properties).

Hope this helps other people struggling too.

1 Like