Is there a way to retrieve the last item on the list marked as success?
children: [
{
case: "no-success",
name: "bruno",
endOffset: 5
},
{
case: "no-success",
name: "pippo",
endOffset: 5
}
{
case: "success",
name: "jo",
endOffset: 5
},
{
case: "success",
name: "Matteo",
endOffset: 5
},
{
case: "np-success",
name: "Robert",
endOffset: 5
}
]
I am specifically looking for the item with the name Matteo.
To find the first matching item, I use: var foundIdx = this.newListWords[i].children.find(item => item.case === 'success').