Segments

A Segments object is an iterable collection of the segments of a text string. It is returned by a call to the segment() method of an Intl.Segmenter object.

Try it

Instance methods

Segments.prototype.containing()

Returns an object describing the segment in the original string that includes the code unit at a specified index.

Segments.prototype[@@iterator]()

Returns an iterator to iterate over the segments.

Specifications

Specification
ECMAScript Internationalization API Specification
# sec-segments-objects

Browser compatibility

BCD tables only load in the browser

See also