// Any combination returns "other" for "en-US".
{
let numbers = [0, 0.5, 1.2, 1.5, 1.7, -1, 1, "1", 123456789.123456789, Infinity, -Infinity];
const weirdCases = [
NaN, "word",
[0, 2],
{},
];
for (let type of ["ordinal", "cardinal"]) {
let pr = new Intl.PluralRules("en-US", {type}); for (let start of numbers) { for (let end of numbers) {
assertEq(pr.selectRange(start, end), "other");
}
}
for (let c of weirdCases) {
assertThrowsInstanceOf(() => pr.selectRange(c, 0), RangeError);
assertThrowsInstanceOf(() => pr.selectRange(0, c), RangeError);
assertThrowsInstanceOf(() => pr.selectRange(c, c), RangeError);
}
}
}
// fr (French) returns different results.
{
let ordinal = new Intl.PluralRules("fr", {type: "ordinal"});
let cardinal = new Intl.PluralRules("fr", {type: "cardinal"});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.