_Objects/Object/isPrototypeOf)
    7. [ ` Object.prototype.propertyIsEnumerable() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable)
    8. [ ` Object.prototype.toLocaleString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toLocaleString)
    9. [ ` Object.prototype.toString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString)
    10. [ ` Object.prototype.valueOf() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)

##  In this article

  * Try it 
  * Syntax 
  * Description 
  * Examples 
  * Specifications 
  * Browser compatibility 
  * See also 

#  String.prototype[@@iterator]()

The **` [@@iterator]() ` ** method of [ ` String ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/String) values implements the
[ iterable protocol ](/en-
US/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be
consumed by most syntaxes expecting iterables, such as the [ spread syntax
](/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [ `
for...of ` ](/en-US/docs/Web/JavaScript/Reference/Statements/for...of) loops.
It returns a [ string iterator object ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) that yields the
Unicode code points of the string value as individual strings.

##  Try it

##  Syntax

js

    
    
    string[Symbol.iterator]()
    

###  Parameters

None.

###  Return value

A new [ iterable iterator object ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) that yields the
Unicode code points of the string value as individual strings.

##  Description

Strings are iterated by Unicode code points. This means grapheme clusters will
be split, but surrogate pairs will be preserved.

js

    
    
    // "Backhand Index Pointing Right: Dark Skin Tone"
    [..."ðð¿"]; // ['ð', 'ð¿']
    // splits into the basic "Backhand Index Pointing Right" emoji and
    // the "Dark skin tone" emoji
    
    // "Family: Man, Boy"
    [..."ð¨âð¦"]; // [ 'ð¨', 'â', 'ð¦' ]
    // splits into the "Man" and "Boy" emoji, joined by a ZWJ
    

##  Examples

###  Iteration using for...of loop

Note that you seldom need to call this method directly. The existence of the `
@@iterator ` method makes strings [ iterable ](/en-
US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) ,
and iterating syntaxes like the ` for...of ` loop automatically call this
method to obtain the iterator to loop over.

js

    
    
    const str = "A\uD835\uDC68B\uD835\uDC69C\uD835\uDC6A";
    
    for (const v of str) {
      console.log(v);
    }
    // "A"
    // "\uD835\uDC68"
    // "B"
    // "\uD835\uDC69"
    // "C"
    // "\uD835\uDC6A"
    

###  Manually hand-rolling the iterator

You may still manually call the ` next() ` method of the returned iterator
object to achieve maximum control over the iteration process.

js

    
    
    const str = "A\uD835\uDC68";
    
    const strIter = str[Symbol.iterator]();
    
    console.log(strIter.next().value); // "A"
    console.log(strIter.next().value); // "\uD835\uDC68"
    

##  Specifications

Specification  
---  
[ ECMAScript Language Specification  
#  sec-string.prototype-@@iterator  ](https://tc39.es/ecma262/multipage/text-
processing.html#sec-string.prototype-@@iterator)  
  
##  Browser compatibility

BCD tables only load in the browser  with JavaScript enabled. Enable
JavaScript to view data.

##  See also

  * [ Polyfill of ` String.prototype[@@iterator] ` in ` core-js ` ](https://github.com/zloirock/core-js#ecmascript-string-and-regexp)
  * [ Text formatting ](/en-US/docs/Web/JavaScript/Guide/Text_formatting) guide 
  * [ ` Symbol.iterator ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator)
  * [ Iteration protocols ](/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)

##  Help improve MDN

Was this page helpful to you?

Yes  No

[ Learn how to contribute
](https://gith