In Javascript, how would I get the index of the key when using:
Object.keys(gp[0].data.gb[0][0]).forEach(key=>{
};
I know I could use a variable and increment it each time but wondered if there is a way the index of the key could be returned.
So if I had:
gp[0].data.gb[0][0].raceCar = "BMW";
gp[0].data.gb[0][0].color = "blue";
gp[0].data.gb[0][0].reg = "W1 8QT";
how can I return the index of the key raceCar/color or reg?
Thanks.