【LetMeFly】2682.找出转圈游戏输家
力扣题目链接:https://leetcode.cn/problems/find-the-losers-of-the-circular-game/
n 个朋友在玩游戏。这些朋友坐成一个圈,按 顺时针方向 从 1 到 n 编号。从第 i 个朋友的位置开始顺时针移动 1 步会到达第 (i …
for in适合遍历对象, for of适合遍历数组。 for in遍历的是数组的索引,对象的属性,以及原型链上的属性。
1.循环数组
区别一:for in 和 for of 都可以循环数组。for in 输出的是数组的index下标,而for of 输出的是数…