JavaScript Intl PluralRules() Constructor Last Updated : 12 Apr, 2023 Comments Improve Suggest changes Like Article Like Report JavaScript Intl PluralRules() Constructor is used for creating Intl.PluralRules 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.PluralRules(loc, opt) Parameters: 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 and type and maximumSignificantDigits etc. Return Value: A PluralRules Object Example 1: This example creates a PluralRules object for the English and Arabic language. JavaScript const eng = new Intl.PluralRules("en"); const ar = new Intl.PluralRules("ar-EG"); console.log(eng.select(1)); console.log(eng.select(2)); console.log(eng.select(6)); console.log(ar.select(1)); console.log(ar.select(2)); console.log(ar.select(6)); Output: one other other one two few Example 2: This example uses the PluralRules object to add a suffix. JavaScript var x = [12, 32, 45, 11]; var pRules = new Intl.PluralRules("en", {type: "ordinal"}); var Mapping = { "one": "st", "two": "nd", "few": "rd", "other": "th", } var suffixArray = x.map((item)=>{ var type = pRules.select(item); var ending = Mapping[type]; return `${item}${ending}` }) console.log(suffixArray) Output: (4) ['12th', '32nd', '45th', '11th'] 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 PluralRules() Constructor S shobhit_sharma Follow Improve Article Tags : JavaScript Web Technologies Similar Reads JavaScript Intl ListFormat() Constructor 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 opt 2 min read JavaScript Intl Segementer() Constructor JavaScript Intl Segmenter() Constructor is used for creating Intl.Segmenter 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.Segmenter(loc, opt) Parameters: It has two parameters both are option 2 min read Constructor newInstance() method in Java with Examples The newInstance() method of a Constructor class is used to create and initialize a new instance of this constructor, with the initialization parameters passed as parameter to this method. Each parameter is unwrapped to match primitive formal parameters, and both primitive and reference parameters ar 3 min read RuleBasedCollator getRules() method in Java with Example The getRules() method of java.text.RuleBasedCollator class is used to get the rule which is used during the initialization of rule based collator object. Syntax: public String getRules() Parameter: This method does not accept any argument as parameter.Return Value: This method returns the rule which 2 min read java.lang.reflect.Constructor Class in Java java.lang.reflect.Constructor class is used to manage the constructor metadata like the name of the constructors, parameter types of constructors, and access modifiers of the constructors. We can inspect the constructors of classes and instantiate objects at runtime. The Constructor[] array will hav 4 min read Modifiers constructorModifiers() method in Java with Examples The constructorModifiers() method of java.lang.reflect.Modifier class is used to get an integer value together with the modifiers of source language that can be applied to a constructor. Syntax: public static boolean constructorModifiers() Parameters: This method accepts nothing. Return: This method 1 min read Array Declarations in Java (Single and Multidimensional) In Java, an Array is used to store multiple values of the same type in a single variable. There are two types of arrays in Java:Single-dimensional arraysMulti-dimensional arraysIn this article, we are going to discuss how to declare and use single and multidimensional arrays in Java.Single-Dimension 6 min read Class getConstructor() method in Java with Examples The getConstructor() method of java.lang.Class class is used to get the specified constructor of this class with the specified parameter type, which is the constructor that is public and its members. The method returns the specified constructor of this class in the form of Constructor object. Syntax 2 min read Ennead Class in JavaTuples A Ennead is a Tuple from JavaTuples library that deals with 9 elements. Since this Ennead is a generic class, it can hold any type of value in it. Since Ennead is a Tuple, hence it also has all the characteristics of JavaTuples:Â They are TypesafeThey are ImmutableThey are IterableThey are Serializa 6 min read Constructor isVarArgs() method in Java with Examples The isVarArgs() method of java.lang.reflect.Constructor class is used to return the boolean value true if this Constructor can take a variable number of arguments as parameters else method will return false.VarArgs allows the constructor to accept a number of arguments. using VarArgs is a better app 2 min read Like