Skip to content
Related Articles

Related Articles

Improve Article

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

  • Last Updated : 16 Apr, 2020

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:

Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it's lowest price ever!

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:




<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:




<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
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :