JavaScript Intl DisplayNames() Constructor Last Updated : 04 Apr, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report JavaScript Intl.DisplayNames Constructor is used for creating Intl.DisplayNames 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.DisplayNames(loc, opt) Parameters: It has two parameters both are optional. loc: It is a String or an array of Strings which allow the following valuenu: It specifies the numbering system to be used which can be arab, bali, latn, tibt etc.opt: It is an object which can have properties like style, type, languageDisplay, fallback etc. Returns: A DisplayNames object. Below examples illustrate the JavaScript Intl DisplayNames() Constructor: Example 1: In this example, we use the properties like dateTimeField and calendar/ JavaScript const example1 = new Intl.DisplayNames("en", { type: "dateTimeField" }); const example2 = new Intl.DisplayNames("fr", { type: "dateTimeField" }); const example3 = new Intl.DisplayNames("en", {type: "calendar"}); console.log(example1.of("year")); console.log(example2.of("year")); console.log(example3.of("chinese")); Output: year année Chinese Calendar Example 2: In this example, we will use properties like Language and LanguageDisplay with the constructor. JavaScript const example1 = new Intl.DisplayNames("en", { type: "language", languageDisplay: "dialect", }); const example2 = new Intl.DisplayNames("fr", { type: "language", languageDisplay: "standard", }); console.log(example1.of("en-GB")); console.log(example2.of("en-GB")); Output: British English anglais (Royaume-Uni) Supported Browsers: ChromeEdgeFirefoxOperaSafari We have a complete list of JavaScript Intl methods to check those please go through, the JavaScript Intl Reference article. Comment More infoAdvertise with us Next Article Calendar getDisplayName() Method in Java with Examples S shobhit_sharma Follow Improve Article Tags : JavaScript Web Technologies Similar Reads Constructor getName() method in Java with Examples The constructor class provides information about a single constructor for a class and it also provides access to that constructor. The getName() method of java.lang.reflect.Constructor is used to return this constructor name, as a string. Constructor name is the binary name of the constructor's decl 1 min read Unnamed Patterns and Variables in Java Java programming language offers multiple features that allow developers to write rich and concise code. Among these features, there are unnamed patterns and variables which enables developers to work with data in a more flexible and elegant way. In this article, we will study about unnamed patterns 4 min read Calendar getDisplayName() Method in Java with Examples The getDisplayName(int cal_field, int cal_style, Locale local) method of Calendar class is used to return the string representation of a calendar field(int cal_field) value in the given style(int cal_style) and locale(int local). Syntax: public String getDisplayName(int cal_field, int cal_style, Loc 3 min read C++ Program to Print Your Own Name Printing your own name means displaying your name on the computer screen. In this article, we will learn how to print your own name using a C++ program.ExamplesInput: name = "Anmol"Output: AnmolExplanation: Given name is printed on the output screen.Input: name = "Alex"Output: AlexExplanation: Given 3 min read Java Identifiers An identifier in Java is the name given to Variables, Classes, Methods, Packages, Interfaces, etc. These are the unique names used to identify programming elements. Every Java Variable must be identified with a unique name.Example:public class Test{ public static void main(String[] args) { int a = 2 2 min read Advantages of getter and setter Over Public Fields in Java with Examples Providing getter and setter methods to access any class field in Java can at first look pointless and meaningless, simply because you can make the field public, and it is available in Java programs from anywhere. In reality, many programmers do this in the early days, but once you start thinking in 2 min read Like