Loop through JSON response objects on postman using a Javascript function

Here below is my JSON response from an API request on postman. I wish to have a function that loops through because I am going to use the function in other requests to pick up certain objects based on the matching conditions and use their properties as variables in my next requests. In my piece of code below, I loop through the response and if an object matches the conditions, I push its index into an array. From the Array I can possibly get the objects and use its parameters in subsequent requests as variables.

API JSON response

{
    "axes": [
        {
            "id": "66ce0ert63f2982cef2e433b0aa6",
            "name": "Product 1",
            "max_number_of_days": 5,
            "tag": "Measure NPS",
            "is_validation_required": false,
            "additionnal_day_allowed": true,
            "is_pause_days_acquired_by_month": false,
            "used_days": 0,
            "booked_days": 0,
            "remaining_days": 5,
            "status": false,
            "icon": "provider_pause/stringxoNx.png",
        },
        {
            "id": "66d4e954b0f85d2ewe1b087ad408",
            "name": "Product 2",
            "max_number_of_days": 54,
            "tag": "Get App Store Ratings",
            "is_validation_required": true,
            "additionnal_day_allowed": false,
            "is_pause_days_acquired_by_month": true,
            "used_days": 0,
            "booked_days": 0,
            "remaining_days": 0,
            "status": false,
        },
        {
            "id": "67039866e21c6dfwt035a9064ed0",
            "name": "Product 3",
            "max_number_of_days": 1,
            "tag": "Garage Pause",
            "is_validation_required": false,
            "additionnal_day_allowed": true,
            "is_pause_days_acquired_by_month": true,
            "used_days": 0,
            "booked_days": 0,
            "remaining_days": 0,
            "status": false,
        },
        {
            "id": "6703f016e21c603wbf5a90ebbbe",
            "name": "Product 4",
            "max_number_of_days": 10,
            "tag": "Garage Pause",
            "is_validation_required": true,
            "additionnal_day_allowed": true,
            "is_pause_days_acquired_by_month": false,
            "used_days": 0,
            "booked_days": 0,
            "remaining_days": 10,
            "status": false,
            "icon": "product_images/c1WH.jpg",
        },
        {
            "id": "6703fed7e21sdswc6035a9103ac3",
            "name": "Product 5",
            "max_number_of_days": 5,
            "tag": "Garage Pause",
            "is_validation_required": false,
            "additionnal_day_allowed": true,
            "is_pause_days_acquired_by_month": true,
            "used_days": 0,
            "booked_days": 0,
            "remaining_days": 0,
            "status": false,
            "icon": "product_images/c1WH.jpg",
        },
        {
            "id": "6703fedae21c6035asd9103ac8",
            "name": "Product 6",
            "max_number_of_days": 5,
            "tag": "Garage Pause",
            "is_validation_required": false,
            "additionnal_day_allowed": true,
            "is_pause_days_acquired_by_month": false,
            "used_days": 0,
            "booked_days": 0,
            "remaining_days": 5,
            "status": false,
            "icon": "provider_pause/Sick Leave36cEFP.png"
        }
    ]
}
//Here is my function

    function additionalDayAllowed(jsonData){
    let permitted_objects = [];
    let number_of_pauses = jsonData.pauses.length;
    let isValidation = jsonData.pauses[i].is_validation_required;
    let isAdditional = jsonData.pauses[i].additionalDayAllowed;
    let isRemaining = jsonData.pauses[i].remaining_days;
    for (let i = 0; i < number_of_pauses; i++)
    {
        If ( isValidation === false && isAdditional === true && isRemaining > 0)
        {
           permitted_objects.push(i)
        }
        
    }
    return permitted_objects;
    }
function additionalDayAllowed(jsonData){
    let permitted_objects = [];
    let number_of_pauses = jsonData.pauses.length;
    let isValidation = jsonData.pauses[i].is_validation_required;
    let isAdditional = jsonData.pauses[i].additionalDayAllowed;
    let isRemaining = jsonData.pauses[i].remaining_days;
    for (let i = 0; i < number_of_pauses; i++)
    {
        If ( isValidation === false && isAdditional === true && isRemaining > 0)
        {
           permitted_objects.push(i)
        }
        
    }
    return permitted_objects;
   }
//Which I tried consuming in a postman sandbox as below;
 pm.test("validations", function () {
    var jsonData = pm.response.json();
    let myExtraDays = extraDaysPermitted(jsonData);
    console.log(myExtraDays[0]);

    });