MomentJS objects are mutable (changeable) objects with state. Calling add on a MomentJS object modifies it, but doesn't create a new object; it just returns a reference to the same object. So say you start with this:
+−−−−−−−−−+
res−>| (array) |
+−−−−−−−−−+ +−−−−−−−−−−+
| 0 |−−−−−−−>| (object) |
+−−−−−−−−−+ +−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| d: |−−>| (Date) |
+−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| [[TimeValue]]: 2017−03−27T18:00:00+01:00 |
+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
Your
let nextTime = moment(res[res.length - 1]).add(1, 'hour');
// ...
res.push(nextTime);
modifies that object and pushes another reference to it onto res:
+−−−−−−−−−+
res−>| (array) |
+−−−−−−−−−+ +−−−−−−−−−−+
| 0 |−−−−+−−>| (object) |
| 1 |−−−/ +−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
+−−−−−−−−−+ | d: |−−>| (Date) |
+−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| [[TimeValue]]: 2017−03−27T19:00:00+01:00 |
+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
Notice how the state of the object (the [[TimeValue]] in the Date used by the MomentJS object) has changed.
If you do it again, we just update it again:
+−−−−−−−−−+
res−>| (array) |
+−−−−−−−−−+ +−−−−−−−−−−+
| 0 |−−−−+−−>| (object) |
| 1 |−−−/ +−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| 2 |−−/ | d: |−−>| (Date) |
+−−−−−−−−−+ +−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| [[TimeValue]]: 2017−03−27T20:00:00+01:00 |
+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
Instead, you want to create a new object. You can do that by cloning the original with moment.
let nextTime = moment(res[res.length - 1]).add(1, 'hour');
// ------------^^^^^^^ ----------------^
// ...
res.push(nextTime);
If you do that, then from the same starting point, we get:
+−−−−−−−−−+
res−>| (array) |
+−−−−−−−−−+ +−−−−−−−−−−+
| 0 |−−−−−−−>| (object) |
| 1 |−−−−+ +−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| 2 |−−+ | | d: |−−>| (Date) |
+−−−−−−−−−+ | | +−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| | | [[TimeValue]]: 2017−03−27T18:00:00+01:00 |
| | +−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| +−−>| (object) |
| +−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| | d: |−−>| (Date) |
| +−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
+−−−−> | [[TimeValue]]: 2017−03−27T19:00:00+01:00 |
+−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| (object) |
+−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| d: |−−>| (Date) |
+−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
| [[TimeValue]]: 2017−03−27T20:00:00+01:00 |
+−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
nextTime, a MomentJS instance?