The abstract operation InitializePluralRules accepts the arguments pluralRules (which must be an object), locales, and options. It initializes pluralRules as a PluralRules object. It performs the following steps:
A PluralRules select function is an anonymous function that takes one argument value, and performs the following steps:
When the ResolvePlural abstract operation is called with arguments pluralRules (which must be an object initialized as a PluralRules) and x (which must be a Number value), it returns a String value representing the plural form of x according to the effective locale and the options of pluralRules.
The following steps are taken:
The PluralRules constructor is a standard built-in property of the Intl object. Behaviour common to all service constructor properties of the Intl object is specified in
When the
The Intl.PluralRules constructor has the following properties:
The value of
This property has the attributes { [[Writable]]:
When the
The value of the
The value of the [[availableLocales]] internal slot is implementation defined within the constraints described in
The value of the [[relevantExtensionKeys]] internal slot is
The value of the [[localeData]] internal slot is implementation defined within the constraints described in
The Intl.PluralRules prototype object is itself an Intl.PluralRules instance as specified in
In the following descriptions of functions that are properties or [[Get]] attributes of properties of
The initial value of
The initial value of the @@toStringTag property is the string value
This property has the attributes { [[Writable]]:
Intl.PluralRules.prototype.select is an accessor property whose set accessor function is
This function provides access to the locale and options computed during initialization of the object.
The function returns a new object whose properties and attributes are set as if constructed by an object literal assigning to each of the following properties the value of the corresponding internal slot of this PluralRules object (see
Intl.PluralRules instances inherit properties from
Intl.PluralRules instances and other objects that have been successfully initialized as a PluralRules have [[initializedIntlObject]] and [[initializedPluralRules]] internal slots whose values are
Objects that have been successfully initialized as a PluralRules object also have several internal slots that are computed by the constructor:
Finally, objects that have been successfully initialized as a PluralRules have a [[boundResolve]] internal slot that caches the function returned by the select accessor (