I am having below data

```
 var counts = ["2017-01-01T00:00:00Z", 0, "2017-02-01T00:00:00Z", 0, "2017-03-01T00:00:00Z", 0, "2017-04-01T00:00:00Z", 0, "2017-05-01T00:00:00Z", 0, "2017-06-01T00:00:00Z", 0, "2017-07-01T00:00:00Z", 0, "2017-08-01T00:00:00Z", 0, "2017-09-01T00:00:00Z", 0, "2017-10-01T00:00:00Z", 0, "2017-11-01T00:00:00Z", 0, "2017-12-01T00:00:00Z", 0, "2018-01-01T00:00:00Z", 0, "2018-02-01T00:00:00Z", 0, "2018-03-01T00:00:00Z", 0, "2018-04-01T00:00:00Z", 18, "2018-05-01T00:00:00Z", 482, "2018-06-01T00:00:00Z", 272];

```

I am trying below code to get my expected result but unfortunately not getting result.

```
var result = [];
for (i = 0; i < counts.length; i++) {
    console.log(counts[i]);
    resultObj = {"date":counts[i],"post":counts[i+1]};
    result.push(resultObj);
}

```

Expected result

```
var finalResults = [{"date":"2017-01-01T00:00:00Z",post:0},{"date":"2017-02-01T00:00:00Z",post:0},{"date":"2017-03-01T00:00:00Z",post:0},{"date":"2017-04-01T00:00:00Z",post:0},{"date":"2017-05-01T00:00:00Z",post:0},{"date":"2017-06-01T00:00:00Z",post:0},{"date":"2017-07-01T00:00:00Z",post:0},{"date":"2017-08-01T00:00:00Z",post:0},{"date":"2017-09-01T00:00:00Z",post:0},{"date":"2017-10-01T00:00:00Z",post:0},{"date":"2017-11-01T00:00:00Z",post:0},{"date":"2017-12-01T00:00:00Z",post:0},{"date":"2018-01-01T00:00:00Z",post:0},{"date":"2018-02-01T00:00:00Z",post:0},{"date":"2018-03-01T00:00:00Z",post:0},{"date":"2018-04-01T00:00:00Z",post:18},{"date":"2018-05-01T00:00:00Z",post:482},{"date":"2018-06-01T00:00:00Z",post:272}]

```

```js
var counts = ["2017-01-01T00:00:00Z", 0, "2017-02-01T00:00:00Z", 0, "2017-03-01T00:00:00Z", 0, "2017-04-01T00:00:00Z", 0, "2017-05-01T00:00:00Z", 0, "2017-06-01T00:00:00Z", 0, "2017-07-01T00:00:00Z", 0, "2017-08-01T00:00:00Z", 0, "2017-09-01T00:00:00Z", 0, "2017-10-01T00:00:00Z", 0, "2017-11-01T00:00:00Z", 0, "2017-12-01T00:00:00Z", 0, "2018-01-01T00:00:00Z", 0, "2018-02-01T00:00:00Z", 0, "2018-03-01T00:00:00Z", 0, "2018-04-01T00:00:00Z", 18, "2018-05-01T00:00:00Z", 482, "2018-06-01T00:00:00Z", 272];

var result = [];
for (i = 0; i < counts.length; i++) {
  console.log(counts[i]);
  resultObj = {
    "date": counts[i],
    "post": counts[i + 1]
  };
  result.push(resultObj);
}

console.log(result)
```