I have an API that returns the data as an object in this format attached below, I'm trying to write a function that wou
Posted: Mon Jul 11, 2022 9:53 am
I have an API that returns the data as an object in this formatattached below, I'm trying to write a function thatwould take the object as an input, then output the occurrence ofeach status value in an object array: i.e. [ERROR: 2,WARNING: 3, OK: 2]. The problem is that I don't knowhow to access and count the values when 'status' is nested underdifferent layers.
```
```
This is the function I'm trying to modify to achieve what Iwant, it only works when 'obj' is a parent of an object with the'status' key
```
}
```
```
```
This is the function I'm trying to modify to achieve what Iwant, it only works when 'obj' is a parent of an object with the'status' key
```
}
```