UNB/ CS/ David Bremner/ teaching/ cs2613/ books/ mdn/ Reference/ Global Objects/ Intl/ Collator/ Intl.Collator.prototype.resolvedOptions()

The resolvedOptions() method of Intl.Collator instances returns a new object with properties reflecting the locale and collation options computed during initialization of this collator object.

Syntax

resolvedOptions()

Parameters

None.

Return value

A new object with properties reflecting the locale and collation options computed during the initialization of the given Intl.Collator object.

Description

The resulting object has the following properties:

Examples

Using the resolvedOptions method

const de = new Intl.Collator("de", { sensitivity: "base" });
const usedOptions = de.resolvedOptions();

usedOptions.locale; // "de"
usedOptions.usage; // "sort"
usedOptions.sensitivity; // "base"
usedOptions.ignorePunctuation; // false
usedOptions.collation; // "default"
usedOptions.numeric; // false

Specifications

Browser compatibility

See also