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

The resolvedOptions() method of Intl.DisplayNames instances returns a new object with properties reflecting the locale and style formatting options computed during the construction of this Intl.DisplayNames object.

Syntax

resolvedOptions()

Parameters

None.

Return value

An object with properties reflecting the locale and formatting options computed during the construction of the given Intl.DisplayNames object.

Description

The object returned by resolvedOptions() has the following properties:

Examples

Using resolvedOptions

const displayNames = new Intl.DisplayNames(["de-DE"], { type: "region" });

const usedOptions = displayNames.resolvedOptions();
console.log(usedOptions.locale); // "de-DE"
console.log(usedOptions.style); // "long"
console.log(usedOptions.type); // "region"
console.log(usedOptions.fallback); // "code"

Specifications

Browser compatibility

See also