Intl.Segments

Baseline 2024
Newly available

Since April 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Une instance Intl.Segments est une collection itérable des segments d'une chaîne de caractères. On obtient un tel objet en appelant la méthode segment() d'un objet Intl.Segmenter.

Exemple interactif

Méthodes des instances

Segments.prototype.containing()

Renvoie un objet décrivant le segment de la chaîne de caractères originale qui contient le codet situé à l'indice passé en argument.

Segments.prototype[@@iterator]()

Renvoie un itérateur permettant de parcourir les segments.

Spécifications

Specification
ECMAScript® 2025 Internationalization API Specification
# sec-segments-objects

Compatibilité des navigateurs

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
Segments
[Symbol.iterator]
containing

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support