I am having two array like this,

```
let array1 = [
  {
    "id": 23,
    "name": "Telangana",
  }
]

```

Here i need to update array2 `color value inside properties` based on array1 `numberOfProjects value inside latestMetric`. As u can see that in both arrays `stateId and id` are same.If `numberOfProjects` value is in the range `1 - 1000`. I need to update the `color` value as `1`. then `numberOfProjects` value is in the range `1000 - 2000`. I need to update the `color` value as `2`.so on. I dont know how to achieve this. I tried to map those two arrays and can able to get the ID's.But i dont know how to compare them and update the value . Pleas help me.Thanks in advance