moveNext
优质
小牛编辑
140浏览
2023-12-01
Moves the iterator to the next item in a sequence, if possible.
Signature
Iterator.moveNext = function() { /*...*/ }
Iterator.moveNext = function moveNext() { var cachedIndex = this.cachedIndex; if (!cachedIndex) { cachedIndex = this.cachedIndex = this.sequence.getIndex(); } if (this.index >= cachedIndex.length() - 1) { return false; } ++this.index; return true; }
Name | Type(s) | Description |
---|---|---|
returns | boolean | True if the iterator is able to move to a new item, or else false. |