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 Like