📅  最后修改于: 2022-03-11 15:03:43.105000             🧑  作者: Mango
const iterable = [...];
for (const [index, elem] in iterable.entries()) {
f(index, elem);
}
// or
iterable.forEach((elem, index) => {
f(index, elem);
});