A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/javascript/javascript-intl-listformat-resolvedoptions-method/ below:

JavaScript Intl ListFormat resolvedOptions() Method

JavaScript Intl ListFormat resolvedOptions() Method

Last Updated : 24 May, 2023

The Intl.ListFormat.prototype.resolvedOptions() method is an inbuilt method in JavaScript that returns a new object that has characteristics that correspond to the locale and style formatting choices that were determined during the creation of the existing ListFormat object

Syntax:

listFormat.resolvedOptions()

Parameters: This method does not accept any parameter.

Return Value: This method returns an object with properties reflecting the locale and formatting options computed during the construction of the given ListFormat object.

The below examples illustrate the Intl.ListFormat.prototype.resolvedOptions() method in JavaScript:

Example 1: In this example, we will see the use of the Intl.ListFormat.prototype.resolvedOptions() method in JavaScript.

javascript
<script>
    const geeks = new Intl.ListFormat("de-DE", { style: "short" });
    
    const result = geeks.resolvedOptions();
    console.log(result.locale); 
    console.log(result.style);  
    console.log(result.type); 
</script>

Output: 

"de-DE"
"short"
"conjunction"

Example 2: In this example, we will see the use of the Intl.ListFormat.prototype.resolvedOptions() method in JavaScript.

javascript
<script>
    const geeks = new Intl.ListFormat("hi");
    
    const result = geeks.resolvedOptions();
    console.log(result.locale); 
    console.log(result.style);  
    console.log(result.type); 
    console.log(result.collation); 
    console.log(result.numeric); 
</script>

Output:

"hi"
"long"
"conjunction"
undefined
undefined

Supported Browsers: The browsers supported by Intl.ListFormat.prototype.resolvedOptions() method are listed below: 



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4