ription 
  * Constructor 
  * Static methods 
  * Instance properties 
  * Instance methods 
  * Examples 
  * Specifications 
  * Browser compatibility 
  * See also 

#  Iterator

An **` Iterator ` ** object is an object that conforms to the [ iterator
protocol ](/en-
US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol) by
providing a ` next() ` method that returns an iterator result object. All
built-in iterators inherit from the ` Iterator ` class. The ` Iterator ` class
provides a [ ` @@iterator ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/@@iterator) method
that returns the iterator object itself, making the iterator also [ iterable
](/en-
US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) .
It also provides some helper methods for working with iterators.

##  Description

The following are all built-in JavaScript iterators:

  * The _Array Iterator_ returned by [ ` Array.prototype.values() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) , [ ` Array.prototype.keys() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys) , [ ` Array.prototype.entries() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) , [ ` Array.prototype[@@iterator]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator) , [ ` TypedArray.prototype.values() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/values) , [ ` TypedArray.prototype.keys() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/keys) , [ ` TypedArray.prototype.entries() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/entries) , [ ` TypedArray.prototype[@@iterator]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/@@iterator) , and [ ` arguments[@@iterator]() ` ](/en-US/docs/Web/JavaScript/Reference/Functions/arguments/@@iterator) . 
  * The _String Iterator_ returned by [ ` String.prototype[@@iterator]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/@@iterator) . 
  * The _Map Iterator_ returned by [ ` Map.prototype.values() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values) , [ ` Map.prototype.keys() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/keys) , [ ` Map.prototype.entries() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries) , and [ ` Map.prototype[@@iterator]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/@@iterator) . 
  * The _Set Iterator_ returned by [ ` Set.prototype.values() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values) , [ ` Set.prototype.keys() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/keys) , [ ` Set.prototype.entries() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries) , and [ ` Set.prototype[@@iterator]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/@@iterator) . 
  * The _RegExp String Iterator_ returned by [ ` RegExp.prototype[@@matchAll]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll) and [ ` String.prototype.matchAll() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll) . 
  * The [ ` Generator ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator) object returned by [ generator functions ](/en-US/docs/Web/JavaScript/Reference/Statements/function*) . 
  * The _Segments Iterator_ returned by the [ ` [@@iterator]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment/Segments/@@iterator) method of the [ ` Segments ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment/Segments) object returned by [ ` Intl.Segmenter.prototype.segment() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment) . 
  * The _Iterator Helper_ returned by iterator helper methods such as [ ` Iterator.prototype.filter() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/filter) and