Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

JavaScript | Intl.ListFormat.prototype.resolvedOptions() Method

  • Last Updated : 18 Nov, 2021

The Intl.ListFormat.prototype.resolvedOptions() method is an inbuilt method in JavaScript which returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current 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.
Below examples illustrate the Intl.ListFormat.prototype.resolvedOptions() method in JavaScript:
Example 1: 
 

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"
"short"
"conjunction"

Example 2: 
 

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: 
 

  • Google Chrome 72 and above
  • Edge 79 and above
  • Firefox 78 and above
  • Opera 60 and above
  • Safari 14.1 and above

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!