Check out example codes for "get keys of an array angualr". It will help you in understanding the concepts better.

Code Example 1

for (let obj of arr) {
    console.log("object:", obj);
    for (let key in obj) {
        console.log("      key:", key, "value:", obj[key]);
    }
}

Learn ReactJs, React Native from akashmittal.com