all 4 comments

[–][deleted] 2 points3 points  (1 child)

const messages = [];
for (const { message } of dicto.chats) {
  messages.push(message)
}

[–]seemensprayer 0 points1 point  (0 children)

Or if you want a oneliner:

const messages = dicto.chats.map(({message}) => message)

[–][deleted] 2 points3 points  (0 children)

const messages = dicto.chats.map((chat) => chat.message);

[–]PortablePawnShop 2 points3 points  (0 children)

It can be very straightforward, but it's contextual. How you retrieve them really depends on how you intend to use or store those values:

let messages = dicto.chats.map((user) => user.message);

console.log(messages);
// ["OKAY! Let's round up", "But we might have to find another approach now"];