Is there a way to verify if the value of "startAt" is present in an object and return its corresponding ID?
Here is the object in question:
[{
"id": "1234567",
"createTimestamp": "2020",
"name": {
"action": "",
"allDay": false,
"category": "Misc",
"startAt": "05",
"title": "foo"
},
"updateTimestamp": "2020"
}]
Below is my progress so far. The filtering works, but I'm struggling to access and return the ID.
<div v-for="(hour, i) in 24" :key="i">
{{ filterByHour(hour) }}
</div>
filterByHour(id) {
if (id < 10) {
id = 0 + id
}
const result = this.events.filter(item => item.name.startAt === id.toString())
return result
}
Any suggestions on how to successfully return the ID of the object?