How could I have the index of an array 'roll over' when incrementing?

前端 未结 4 373
刺人心
刺人心 2020-12-20 19:59

So I have an Array with a length of 4. When I increment it by 1 and the number gets bigger than the length of the array, I\'d like it to rollover.

For example:

4条回答
提交回复
热议问题