Stage 0 Draft / February 3, 2026

Iterator Includes

1 Iterator.prototype.includes ( searchElement [ , skippedElements ] )

  1. Let O be the this value.
  2. If O is not an Object, throw a TypeError exception.
  3. If skippedElements is undefined, then
    1. Let toSkip be 0.
  4. Else,
    1. If skippedElements is not one of +∞𝔽, -∞𝔽, or an integral Number, throw a TypeError exception.
    2. Let toSkip be the extended mathematical value of skippedElements.
  5. If toSkip < 0, throw a RangeError exception.
  6. Let skipped be 0.
  7. Let iterated be ? GetIteratorDirect(O).
  8. Repeat,
    1. Let value be ? IteratorStepValue(iterated).
    2. If value is done, return false.
    3. If skipped < toSkip, then
      1. Set skipped to skipped + 1.
    4. Else if SameValueZero(value, searchElement) is true, then
      1. Return ? IteratorClose(iterated, NormalCompletion(true)).