There is such an array of months: 

```
let months = ['July', 'August', 'September', 'October', 'November', 'December', 'January', 'February', 'March', 'April', 'May', 'June',];

```

There is such a function:

```
    function headerCellRendererFunc(params) {
        var eHeader = document.createElement('span');
        var eTitle = document.createTextNode(params.colDef.headerName + ' ' + year);
        eHeader.appendChild(eTitle);
        return eHeader;
    }

```

On the way out I get: 

* July'17
* August'17
* September'17
e.t.c...

I need that from January to **year** there was **+ 1**

What would have happened so: 

* July'17 August'17 September'17 October'17 November'17 December'17
January'18 February'18 March'18 April'18 May'18 June'18

How to make a condition in a function?

```
    months.map((month, index) => {
        var year = this.fy;

        function headerCellRendererFunc(params) {
            var eHeader = document.createElement('span');
            var eTitle = document.createTextNode(params.colDef.headerName + ' ' + year);
            eHeader.appendChild(eTitle);
            return eHeader;
        }

        return <ColDef>{
            headerName: month,
            headerCellRenderer: headerCellRendererFunc,
            field: `data.${month}`,
            editable: isEditable,
            valueGetter: cellMonthValueGetter(month, index),
            cellFormatter: cellMonthValueFormatter,
            newValueHandler: cellMonthNewValueHandler(month),
            width: 100,
        };
    }).forEach(colDef => colDefs.push(colDef));

```