I have a data structure like this :

```
var records = [
  {
    firstName: "Akira",
    id: "0543236543",
  },
  {
    firstName: "Harry",
    id: "0994372684",
  },
  {
    firstName: "Sherlock",
    id: "0487345643",
  },
  {
    firstName: "Kristian",
    id: "04873452342",
  },
];

```

I want to create a function that would add the date property (adjusted for hours) to each of object in the array depending on the length of the array.

Here's my code so far

```
function updateObject(obj) {
  let timeNow = new Date();
  let addHours = (h) => timeNow.setHours(timeNow.getHours() + h);
  const ids = obj.map((record) => record.id);
  const lastNames = obj.map((record) => record.id);
  const time = obj.map(
    (record, index) => (record["time"] = new Date(addHours(index)))
  );
  return obj;
}

```

This returns:

```
[
  {
    firstName: 'Akira',
    id: '0543236543',
    time: 2021-05-18T12:25:59.366Z
  },
  {
    firstName: 'Harry',
    id: '0994372684',
    time: 2021-05-18T13:25:59.366Z
  },
  {
    firstName: 'Sherlock',
    id: '0487345643',
    time: 2021-05-18T15:25:59.366Z
  },
  {
    firstName: 'Kristian',
    id: '04873452342',
    time: 2021-05-18T18:25:59.366Z
  }
]

```

First issue: I want to update the time by adding 0,1,2,3 hours to the current time.
Currently it:
adds 0 to time and sets is a current time
adds 1 to updated time and set it a as a current time and so on.

Second:
I want to modify the function so it takes an add additional argument, "time increment" that if set to x will update the time property for first x records for 0 hours and the next x records for 1 hour.

Hope that makes sense :)