I have an object in which I need to find a particular item index number. Below is my object:
[
  {
    "type": "Grayscale",
    "mode": "average"
  }, {
    "type": "Sepia"
  }, {
    "type": "Invert",
    "invert": true
  }, {
    "type": "Convolute",
    "opaque": false,
    "matrix": [1, 1, 1, 1, 0.7, -1, -1, -1, -1]
  }, {
    "type": "Convolute",
    "opaque": false,
    "matrix": [0, -1, 0, -1, 5, -1, 0, -1, 0]
  }, {
    "type": "Brownie"
  }, {
    "type": "Brightness",
    "brightness": 0.35
  }
]
For example, I need to find the index number of the item which has the value Invert for the type property. So in this case, the output should be 2. I only need to search the values of the type key.
 
     
     
    