I have a list li:

[
{name: "Tom", age: 10},
{name: "Mark", age: 5},
{name: "Pam", age: 7}
]

I want to get the index of the item that has a certain name. For example, if I ask for "Tom" it should give me: 0. "Pam" should give me 2.

Edit
Report