JavaScript Intl ListFormat() Constructor Last Updated : 11 Apr, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report JavaScript Intl.ListFormat() Constructor is used for creating Intl.ListFormat object. This constructor is created using the new keyword. If we create the constructor without the new keyword it will give a TypeError. Syntax: new Intl.ListFormat(loc, opt) Parameters: It has two parameters both are optional. loc: It is a String or an array of Strings that contains the general form and interpretation of argumentsopt: It is an object which contains properties like localeMatcher, type, style, etc. Return Type: An Intl.ListFormat object Below examples illustrate the JavaScript Intl ListFormat() Constructor: Example 1: This example creates a conjunction ListFormat. JavaScript var courses = ["DSA", "Web Dev", "Python", "Java"] console.log(new Intl.ListFormat("en-GB", { style: "narrow", type: "conjunction" }).format( courses, ),) console.log(new Intl.ListFormat("en-GB", { style: "long", type: "conjunction" }).format( courses, ),) Output: DSA, Web Dev, Python, Java DSA, Web Dev, Python and Java Example 2: This example creates a disjunction and unit ListFormat JavaScript var courses = ["DSA", "Web Dev", "Python", "Java"] console.log(new Intl.ListFormat("en-GB", { style: "narrow", type: "unit" }).format( courses, ),) console.log(new Intl.ListFormat("en-GB", { style: "long", type: "disjunction" }).format( courses, ),) Output: DSA Web Dev Python Java DSA, Web Dev, Python or Java Supported Browsers: ChromeEdgeFirefoxOperaSafari We have a complete list of JavaScript Intl methods to check please go through, the JavaScript Intl Reference article Comment More infoAdvertise with us Next Article JavaScript Intl ListFormat() Constructor S shobhit_sharma Follow Improve Article Tags : JavaScript Web Technologies Similar Reads JavaScript Intl ListFormat format() Method The Intl.ListFormat.prototype.format() method is an inbuilt method in JavaScript that returns a string with a language-specific representation of the list. Syntax: listFormat.format([list]); Parameters: This method accepts a single parameter as mentioned above and described below: list: This paramet 2 min read JavaScript Intl ListFormat formatToParts() Method The Intl.ListFormat.prototype.formatToParts() method is an inbuilt method in JavaScript that returns an Array of objects representing the different components that can be used to format a list of values in a locale-aware fashion. Syntax: Intl.ListFormat.prototype.formatToParts(list) Parameters: This 2 min read DateFormat Class in Java The java.text.DateFormat is an abstract class that is used to format and parse dates for any locale. It allows us to format date to text and parse text to date. DateFormat class provides many functionalities to obtain, format, parse default date/time. DateFormat class extends Format class that means 4 min read NumberFormat Class in Java NumberFormat is an abstract base class for all number formats. This class provides the interface for formatting and parsing numbers. NumberFormat also provides methods for determining which locales (US, India, Italy, etc.) have number formats and their names. NumberFormat helps you to format and par 2 min read MessageFormat setFormat() method in Java with Example The setFormats() method of java.text.MessageFormat class is used to set the new format element at the particular index in the pattern of this message format object. Syntax: public void setFormat(int formatElementIndex, Format newFormat) Parameters: This method takes the following argument as a param 2 min read Like