title: karate: finding index of the particular element value from API response
body: <p>my code for finding index as below</p>
  
  <pre><code>* def list = nestActual #this is API response value which is given at the end
  * def searchFor = { category_name: 'books3'}
  * def foundAt = []
  * def fun = function(x, i){ if (karate.match(x, searchFor).pass) foundAt.add(i) }
  * eval karate.forEach(list, fun)
  * print "==========foundAt=======" +foundAt
  </code></pre>
  
  <p>i have tried the above code for finding index where im getting foundAt index as null.</p>
  
  <p>Below is my response where i want to find index of "category_name":"books3"</p>
  
  <pre><code>[
  {
  "category_id":1, "parent_cat_id":0, "category_name":"books", "slug_name":"books_1", "popular":true,
  
  }, {
  "category_id":2, "parent_cat_id":1, "category_name":"books2", "slug_name":"books_2", "popular":false,
  
  }, {
  "category_id":3, "parent_cat_id":1, "category_name":"books3", "slug_name":"books3_2", "popular":false,
  
  }, {
  "category_id":4, "parent_cat_id":3, "category_name":"mp3", "slug_name":"mp_3", "popular":false, }, {
  "category_id":5, "parent_cat_id":3, "category_name":"mp4", "slug_name":"humoristiska_deckare_mysi_deck_3", "popular":false, }, {
  "category_id":6, "parent_cat_id":3, "category_name":"video", "slug_name":"video3", "popular":false,
  
  } ]
  </code></pre>
  
  <p>Please let me know how to find index of "category_name":"books3" using karate</p>