How to verify a value in anywhere of the Array

Hi ,

I want to verify whether either 0th or 1st value in below is equal to ‘AF’

“validationResultErrors”: ,
“errorKeys”: ,
“data”: [
“id”: “cd367fba-f943-e911-a817-005056a23fb6”,
“isoNumeric”: “004”,
“name”: “Afghanistan”,
“isoA2”: “AF”
“id”: “cf367fba-f943-e911-a817-005056a23fb6”,
“isoNumeric”: “008”,
“name”: “Albania”,
“isoA2”: “AL”


I used below code.

var i = 0
var jsonArray = pm.response.json();
pm.test(“Verify Received relevant Country List’”, function () {
for(i; i<[i].length;i++){

This is working and Pass. But i just changed the“Hello”) and still it gets Pass.
So it seems my code is incorrect.

Could u please help me on this?

You can loop through the array the way I did below. I think that should work. Give it a shot.

let jsonData = pm.response.json()

for (const ctyAbv of {
pm.test(‘isoA2 expected value’, function () {