将迭代数组的 forEach 循环转换为使用索引迭代数组的等效的 for 循环。