const obj = { kiwi: true, mango: false, pineapple: 500 }; Object.entries(obj).forEach(([k, v], i) => { console.log(k, v, i); }); // kiwi true 0 // mango false 1 // pineapple 500 2