I have already searched for the solution to this question on stackoverflow, but I am still confused. I tried using the same answer they provided but I am still getting an error. Can someone please help me resolve this issue? Thank you.
const typeValue = [
{name: "Subscription", value: "subscription", rank: 2},
{name: "Single", value: "single", rank: 3},
{name: "Trial", value: "trial", rank: 0},
{name: "Unlimited", value: "unlimited", rank: 1000},
{name: "Promo", value: "promo", rank: 1},
{name: "Test", value: "test", rank: 0},
{name: "Brand", value: "brand", rank: 3}
]
I need to find the rank number from my list of objects.
rank: typeValue.find(x => x.value === snapshot.data().type).rank