in

Get specific values from object when mapping through nested object


I want to return an array with specific values of _time & _value. The function that I made is as followed:

getMachineData(data) {
    console.log(data)
    const result = data.map((innerArray) => {
        console.log(typeof innerArray)
        console.log(innerArray)
        // Map over the inner array
        return innerArray.map((item) => {
            console.log(item)
            return ({
                time: item._time,
                value: item._value
            });
        });
    });
    console.log(result);
};

But in this code the last console.log is never hit.

The innerArray data is as followed:

{ "result": "_result", "table": 0, "_start": "2021-01-06T14:35:53Z", "_stop": "2022-01-06T14:35:53Z", "_time": "2021-10-11T10:58:30Z", "_value": 0, "_field": "approved", "_measurement": "oee-data", "end_time_str": "2021-10-11T10:59:00Z", "machine": "almo", "start_time_str": "2021-10-11T10:58:30Z" }



Source: https://stackoverflow.com/questions/70608859/get-specific-values-from-object-when-mapping-through-nested-object

A script utilises payload dumper and image extractor tools to extract the apps from the system.img of an android OTA file

Building a Cupertino App with Flutter