Imagine a scenario where there is an object containing an array of objects.
let events = {
"id": 241,
"name": "Rock Party",
"type": "party",
"days": [
{
"id": 201,
"day": "Monday"
},
{
"id": 202,
"dia": "Friday"
}
],
}
The goal is to extract only the values under the key "day". For instance:
let days = ["Monday", "Friday"]
I attempted using Object.values(events.days[0]), however, the outcome was different:
[201, 'Monday']