Suppose I am searching for cardType = points
, if its found I want to know the index position of that object. According to the given example array, index position of this object is 1. Below is the example array.
[{
cardCode = MGC;
cardId = 5720663d8944bf6710c9d894;
cardType = gift;
},
{
cardCode = MPC;
cardId = 5720663d8944bf6710c9d898;
cardType = points;
},
{
cardCode = MAC;
cardId = 5720663d8944bf6710c9d895;
cardType = advantage;
},
{
cardCode = MCC;
cardId = 5720663d8944bf6710c9d897;
cardType = cashback;
}]