When a learner can reproduce a familiar example but a small variation causes confusion, the problem is usually an incomplete model rather than a lack of effort. The fastest useful response is to expose the hidden state and test one boundary at a time.
JavaScript Intl.PluralRules selects a locale-sensitive grammatical category for a number. The category—zero, one, two, few, many or other—is an instruction for choosing an already translated message pattern, not a universal mathematical test and not a formatter that writes the final sentence. Mastery means negotiating the intended locale, choosing cardinal or ordinal rules, accounting for digit-rounding options, providing an other fallback, testing the categories the runtime reports, and treating selectRange() as a capability that must be checked in the deployed environment. This guide begins with that mechanism, then develops it through worked traces, deliberate mistakes, explained practice and transfer decisions.
The aim is independent reasoning. A learner should be able to predict behaviour, locate the earliest wrong assumption, use a safe diagnostic procedure and defend a design choice in a new project.
Punggol families can use the guide in short sessions around homework, CCAs and rest. The activities are proposed learning exercises, not claims about a physical branch, timetable, class size, fee, school relationship or guaranteed result.
Use disposable data and repositories, preserve backups, and check version-sensitive details against the official source. Current documentation settles a technical contract; observation and explanation turn that contract into usable knowledge.
Find your next learning step
Choose the route that matches the present difficulty. Use the complete index for a systematic course.
Build the model
Chapters 1-4 . Begin here, then continue after the learner can predict, verify and explain.
Use the core tools
Chapters 5-8 . Begin here, then continue after the learner can predict, verify and explain.
Handle boundaries
Chapters 9-12 . Begin here, then continue after the learner can predict, verify and explain.
Debug and verify
Chapters 13-16 . Begin here, then continue after the learner can predict, verify and explain.
Transfer with judgment
Chapters 17-20 . Begin here, then continue after the learner can predict, verify and explain.
Open the full chapter index . Jump to capstone practice . Use the How Studying Works hub . Read the official documentation
Complete chapter index
Chapters 1-4 . Build the model
Chapters 5-8 . Use the core tools
Chapters 9-12 . Handle boundaries
Chapters 13-16 . Debug and verify
PluralRules maps a numeric input to a locale rule category; it does not translate nouns or assemble a sentence. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is adding an s whenever the returned category is not one. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Plural categories are grammatical selectors, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Plural categories are grammatical selectors chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on adding an s whenever the returned category is not one. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const pr=new Intl.PluralRules('en');
console.log(pr.select(1),pr.select(2));Explained result. English cardinal rules return one then other, but the application still chooses complete message patterns. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: homework counter. Predict the rule using a dashboard chooses a translated message for completed questions. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “PluralRules maps a numeric input to a locale rule category; it does not translate nouns or assemble a sentence.” Apply this procedure: State the contract for Plural categories are grammatical selectors, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English cardinal rules return one then other, but the application still chooses complete message patterns. For the homework counter, add one near-miss that exposes adding an s whenever the returned category is not one. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: reading tracker. Contrast the rule using book and page counts use locale-specific cardinal categories. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “PluralRules maps a numeric input to a locale rule category; it does not translate nouns or assemble a sentence.” Apply this procedure: State the contract for Plural categories are grammatical selectors, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English cardinal rules return one then other, but the application still chooses complete message patterns. For the reading tracker, add one near-miss that exposes adding an s whenever the returned category is not one. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: science display. Stress-test the rule using rounded measurements select a message without rewriting the number. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “PluralRules maps a numeric input to a locale rule category; it does not translate nouns or assemble a sentence.” Apply this procedure: State the contract for Plural categories are grammatical selectors, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English cardinal rules return one then other, but the application still chooses complete message patterns. For the science display, add one near-miss that exposes adding an s whenever the returned category is not one. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: CCA registration. Explain the rule using place labels use ordinal categories where the locale supports them. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “PluralRules maps a numeric input to a locale rule category; it does not translate nouns or assemble a sentence.” Apply this procedure: State the contract for Plural categories are grammatical selectors, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English cardinal rules return one then other, but the application still chooses complete message patterns. For the CCA registration, add one near-miss that exposes adding an s whenever the returned category is not one. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers adding an s whenever the returned category is not one.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Plural categories are grammatical selectors, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Plural categories are grammatical selectors?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing adding an s whenever the returned category is not one be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny library catalogue with a message dictionary covers every reported category and an other fallback. Include one ordinary case, one boundary and one deliberate failure caused by adding an s whenever the returned category is not one. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: PluralRules maps a numeric input to a locale rule category; it does not translate nouns or assemble a sentence. It shows a trace, not only a final value. The ordinary case should demonstrate “English cardinal rules return one then other, but the application still chooses complete message patterns.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Plural categories are grammatical selectors, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Plural categories are grammatical selectors, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
The requested locale list is resolved against locale data available in the implementation. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is assuming every arbitrary language tag is supported exactly as requested. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for The constructor negotiates locale, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the The constructor negotiates locale chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on assuming every arbitrary language tag is supported exactly as requested. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const pr=new Intl.PluralRules(['fr-SG','fr']);
console.log(pr.resolvedOptions().locale);Explained result. resolvedOptions reveals the locale actually selected by the runtime. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: science display. Contrast the rule using rounded measurements select a message without rewriting the number. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The requested locale list is resolved against locale data available in the implementation.” Apply this procedure: State the contract for The constructor negotiates locale, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: resolvedOptions reveals the locale actually selected by the runtime. For the science display, add one near-miss that exposes assuming every arbitrary language tag is supported exactly as requested. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: CCA registration. Stress-test the rule using place labels use ordinal categories where the locale supports them. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The requested locale list is resolved against locale data available in the implementation.” Apply this procedure: State the contract for The constructor negotiates locale, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: resolvedOptions reveals the locale actually selected by the runtime. For the CCA registration, add one near-miss that exposes assuming every arbitrary language tag is supported exactly as requested. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: family planner. Explain the rule using day ranges choose a range category only when the runtime exposes selectRange. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The requested locale list is resolved against locale data available in the implementation.” Apply this procedure: State the contract for The constructor negotiates locale, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: resolvedOptions reveals the locale actually selected by the runtime. For the family planner, add one near-miss that exposes assuming every arbitrary language tag is supported exactly as requested. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: library catalogue. Transfer the rule using a message dictionary covers every reported category and an other fallback. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The requested locale list is resolved against locale data available in the implementation.” Apply this procedure: State the contract for The constructor negotiates locale, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: resolvedOptions reveals the locale actually selected by the runtime. For the library catalogue, add one near-miss that exposes assuming every arbitrary language tag is supported exactly as requested. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers assuming every arbitrary language tag is supported exactly as requested.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for The constructor negotiates locale, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from The constructor negotiates locale?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing assuming every arbitrary language tag is supported exactly as requested be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny test laboratory with locales, decimals, negatives, special numbers and unsupported range methods are recorded. Include one ordinary case, one boundary and one deliberate failure caused by assuming every arbitrary language tag is supported exactly as requested. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: The requested locale list is resolved against locale data available in the implementation. It shows a trace, not only a final value. The ordinary case should demonstrate “resolvedOptions reveals the locale actually selected by the runtime.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for The constructor negotiates locale, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For The constructor negotiates locale, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Without type ordinal, the object applies cardinal quantity rules. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using default rules for first, second and third labels. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Cardinal is the default type, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Cardinal is the default type chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using default rules for first, second and third labels. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
new Intl.PluralRules('en').select(2)Explained result. The result describes the quantity two, not the ordinal second. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: family planner. Stress-test the rule using day ranges choose a range category only when the runtime exposes selectRange. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Without type ordinal, the object applies cardinal quantity rules.” Apply this procedure: State the contract for Cardinal is the default type, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The result describes the quantity two, not the ordinal second. For the family planner, add one near-miss that exposes using default rules for first, second and third labels. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: library catalogue. Explain the rule using a message dictionary covers every reported category and an other fallback. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Without type ordinal, the object applies cardinal quantity rules.” Apply this procedure: State the contract for Cardinal is the default type, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The result describes the quantity two, not the ordinal second. For the library catalogue, add one near-miss that exposes using default rules for first, second and third labels. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: test laboratory. Transfer the rule using locales, decimals, negatives, special numbers and unsupported range methods are recorded. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Without type ordinal, the object applies cardinal quantity rules.” Apply this procedure: State the contract for Cardinal is the default type, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The result describes the quantity two, not the ordinal second. For the test laboratory, add one near-miss that exposes using default rules for first, second and third labels. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: design decision. Predict the rule using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Without type ordinal, the object applies cardinal quantity rules.” Apply this procedure: State the contract for Cardinal is the default type, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The result describes the quantity two, not the ordinal second. For the design decision, add one near-miss that exposes using default rules for first, second and third labels. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using default rules for first, second and third labels.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Cardinal is the default type, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Cardinal is the default type?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using default rules for first, second and third labels be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny design decision with PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. Include one ordinary case, one boundary and one deliberate failure caused by using default rules for first, second and third labels. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Without type ordinal, the object applies cardinal quantity rules. It shows a trace, not only a final value. The ordinary case should demonstrate “The result describes the quantity two, not the ordinal second.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Cardinal is the default type, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Cardinal is the default type, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
type ordinal selects rules intended for ordinal positions when the locale defines distinctions. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using ordinal output for item counts. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Ordinal rules are explicit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Ordinal rules are explicit chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using ordinal output for item counts. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const ord=new Intl.PluralRules('en',{type:'ordinal'});
[1,2,3,4].map(n=>ord.select(n))Explained result. English produces one, two, few, other for these positions, which can map to complete localized ordinal messages. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: test laboratory. Explain the rule using locales, decimals, negatives, special numbers and unsupported range methods are recorded. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “type ordinal selects rules intended for ordinal positions when the locale defines distinctions.” Apply this procedure: State the contract for Ordinal rules are explicit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English produces one, two, few, other for these positions, which can map to complete localized ordinal messages. For the test laboratory, add one near-miss that exposes using ordinal output for item counts. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: design decision. Transfer the rule using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “type ordinal selects rules intended for ordinal positions when the locale defines distinctions.” Apply this procedure: State the contract for Ordinal rules are explicit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English produces one, two, few, other for these positions, which can map to complete localized ordinal messages. For the design decision, add one near-miss that exposes using ordinal output for item counts. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework counter. Predict the rule using a dashboard chooses a translated message for completed questions. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “type ordinal selects rules intended for ordinal positions when the locale defines distinctions.” Apply this procedure: State the contract for Ordinal rules are explicit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English produces one, two, few, other for these positions, which can map to complete localized ordinal messages. For the homework counter, add one near-miss that exposes using ordinal output for item counts. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: reading tracker. Contrast the rule using book and page counts use locale-specific cardinal categories. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “type ordinal selects rules intended for ordinal positions when the locale defines distinctions.” Apply this procedure: State the contract for Ordinal rules are explicit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English produces one, two, few, other for these positions, which can map to complete localized ordinal messages. For the reading tracker, add one near-miss that exposes using ordinal output for item counts. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using ordinal output for item counts.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Ordinal rules are explicit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Ordinal rules are explicit?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using ordinal output for item counts be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework counter with a dashboard chooses a translated message for completed questions. Include one ordinary case, one boundary and one deliberate failure caused by using ordinal output for item counts. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: type ordinal selects rules intended for ordinal positions when the locale defines distinctions. It shows a trace, not only a final value. The ordinary case should demonstrate “English produces one, two, few, other for these positions, which can map to complete localized ordinal messages.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Ordinal rules are explicit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Ordinal rules are explicit, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
select converts and rounds according to the object’s options, then returns one of the standard category labels. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is expecting select to return a Boolean or the input number. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for select returns a category string, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the select returns a category string chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on expecting select to return a Boolean or the input number. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const category=new Intl.PluralRules('ar').select(2);Explained result. The result is a string category used as a lookup key. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: homework counter. Transfer the rule using a dashboard chooses a translated message for completed questions. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “select converts and rounds according to the object’s options, then returns one of the standard category labels.” Apply this procedure: State the contract for select returns a category string, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The result is a string category used as a lookup key. For the homework counter, add one near-miss that exposes expecting select to return a Boolean or the input number. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: reading tracker. Predict the rule using book and page counts use locale-specific cardinal categories. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “select converts and rounds according to the object’s options, then returns one of the standard category labels.” Apply this procedure: State the contract for select returns a category string, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The result is a string category used as a lookup key. For the reading tracker, add one near-miss that exposes expecting select to return a Boolean or the input number. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: science display. Contrast the rule using rounded measurements select a message without rewriting the number. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “select converts and rounds according to the object’s options, then returns one of the standard category labels.” Apply this procedure: State the contract for select returns a category string, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The result is a string category used as a lookup key. For the science display, add one near-miss that exposes expecting select to return a Boolean or the input number. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: CCA registration. Stress-test the rule using place labels use ordinal categories where the locale supports them. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “select converts and rounds according to the object’s options, then returns one of the standard category labels.” Apply this procedure: State the contract for select returns a category string, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The result is a string category used as a lookup key. For the CCA registration, add one near-miss that exposes expecting select to return a Boolean or the input number. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers expecting select to return a Boolean or the input number.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for select returns a category string, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from select returns a category string?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing expecting select to return a Boolean or the input number be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny reading tracker with book and page counts use locale-specific cardinal categories. Include one ordinary case, one boundary and one deliberate failure caused by expecting select to return a Boolean or the input number. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: select converts and rounds according to the object’s options, then returns one of the standard category labels. It shows a trace, not only a final value. The ordinary case should demonstrate “The result is a string category used as a lookup key.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for select returns a category string, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For select returns a category string, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
The label one does not universally mean the number equals exactly one; locale grammar and visible fraction digits govern the result. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is writing a one category check as a language-independent equality test. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Category names are not numeric equality, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Category names are not numeric equality chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on writing a one category check as a language-independent equality test. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const fr=new Intl.PluralRules('fr');
console.log(fr.select(0),fr.select(1));Explained result. The categories follow French plural data, demonstrating that labels are grammatical classes rather than equations. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: science display. Predict the rule using rounded measurements select a message without rewriting the number. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The label one does not universally mean the number equals exactly one; locale grammar and visible fraction digits govern the result.” Apply this procedure: State the contract for Category names are not numeric equality, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The categories follow French plural data, demonstrating that labels are grammatical classes rather than equations. For the science display, add one near-miss that exposes writing a one category check as a language-independent equality test. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: CCA registration. Contrast the rule using place labels use ordinal categories where the locale supports them. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The label one does not universally mean the number equals exactly one; locale grammar and visible fraction digits govern the result.” Apply this procedure: State the contract for Category names are not numeric equality, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The categories follow French plural data, demonstrating that labels are grammatical classes rather than equations. For the CCA registration, add one near-miss that exposes writing a one category check as a language-independent equality test. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: family planner. Stress-test the rule using day ranges choose a range category only when the runtime exposes selectRange. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The label one does not universally mean the number equals exactly one; locale grammar and visible fraction digits govern the result.” Apply this procedure: State the contract for Category names are not numeric equality, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The categories follow French plural data, demonstrating that labels are grammatical classes rather than equations. For the family planner, add one near-miss that exposes writing a one category check as a language-independent equality test. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: library catalogue. Explain the rule using a message dictionary covers every reported category and an other fallback. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The label one does not universally mean the number equals exactly one; locale grammar and visible fraction digits govern the result.” Apply this procedure: State the contract for Category names are not numeric equality, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The categories follow French plural data, demonstrating that labels are grammatical classes rather than equations. For the library catalogue, add one near-miss that exposes writing a one category check as a language-independent equality test. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers writing a one category check as a language-independent equality test.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Category names are not numeric equality, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Category names are not numeric equality?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing writing a one category check as a language-independent equality test be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny science display with rounded measurements select a message without rewriting the number. Include one ordinary case, one boundary and one deliberate failure caused by writing a one category check as a language-independent equality test. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: The label one does not universally mean the number equals exactly one; locale grammar and visible fraction digits govern the result. It shows a trace, not only a final value. The ordinary case should demonstrate “The categories follow French plural data, demonstrating that labels are grammatical classes rather than equations.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Category names are not numeric equality, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Category names are not numeric equality, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Fractional operands participate in locale plural rules and may select a different category from nearby integers. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is testing only 0, 1 and 2 and declaring coverage complete. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Decimals can follow different rules, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Decimals can follow different rules chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on testing only 0, 1 and 2 and declaring coverage complete. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const pr=new Intl.PluralRules('en');
[1,1.2,2].map(n=>pr.select(n))Explained result. English cardinal selection treats 1 as one while 1.2 and 2 select other. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: family planner. Contrast the rule using day ranges choose a range category only when the runtime exposes selectRange. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Fractional operands participate in locale plural rules and may select a different category from nearby integers.” Apply this procedure: State the contract for Decimals can follow different rules, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English cardinal selection treats 1 as one while 1.2 and 2 select other. For the family planner, add one near-miss that exposes testing only 0, 1 and 2 and declaring coverage complete. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: library catalogue. Stress-test the rule using a message dictionary covers every reported category and an other fallback. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Fractional operands participate in locale plural rules and may select a different category from nearby integers.” Apply this procedure: State the contract for Decimals can follow different rules, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English cardinal selection treats 1 as one while 1.2 and 2 select other. For the library catalogue, add one near-miss that exposes testing only 0, 1 and 2 and declaring coverage complete. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: test laboratory. Explain the rule using locales, decimals, negatives, special numbers and unsupported range methods are recorded. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Fractional operands participate in locale plural rules and may select a different category from nearby integers.” Apply this procedure: State the contract for Decimals can follow different rules, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English cardinal selection treats 1 as one while 1.2 and 2 select other. For the test laboratory, add one near-miss that exposes testing only 0, 1 and 2 and declaring coverage complete. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: design decision. Transfer the rule using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Fractional operands participate in locale plural rules and may select a different category from nearby integers.” Apply this procedure: State the contract for Decimals can follow different rules, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English cardinal selection treats 1 as one while 1.2 and 2 select other. For the design decision, add one near-miss that exposes testing only 0, 1 and 2 and declaring coverage complete. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers testing only 0, 1 and 2 and declaring coverage complete.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Decimals can follow different rules, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Decimals can follow different rules?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing testing only 0, 1 and 2 and declaring coverage complete be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny CCA registration with place labels use ordinal categories where the locale supports them. Include one ordinary case, one boundary and one deliberate failure caused by testing only 0, 1 and 2 and declaring coverage complete. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Fractional operands participate in locale plural rules and may select a different category from nearby integers. It shows a trace, not only a final value. The ordinary case should demonstrate “English cardinal selection treats 1 as one while 1.2 and 2 select other.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Decimals can follow different rules, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Decimals can follow different rules, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Minimum and maximum fraction digits or significant digits can change the rounded representation used for rule selection. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is formatting with one policy and selecting a message with an unrelated policy. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Digit options influence selection, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Digit options influence selection chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on formatting with one policy and selecting a message with an unrelated policy. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const pr=new Intl.PluralRules('en',{minimumFractionDigits:1});
console.log(pr.select(1));Explained result. The visible fractional representation can affect plural operands, so formatter and selector options should be designed together. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: test laboratory. Stress-test the rule using locales, decimals, negatives, special numbers and unsupported range methods are recorded. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Minimum and maximum fraction digits or significant digits can change the rounded representation used for rule selection.” Apply this procedure: State the contract for Digit options influence selection, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The visible fractional representation can affect plural operands, so formatter and selector options should be designed together. For the test laboratory, add one near-miss that exposes formatting with one policy and selecting a message with an unrelated policy. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: design decision. Explain the rule using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Minimum and maximum fraction digits or significant digits can change the rounded representation used for rule selection.” Apply this procedure: State the contract for Digit options influence selection, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The visible fractional representation can affect plural operands, so formatter and selector options should be designed together. For the design decision, add one near-miss that exposes formatting with one policy and selecting a message with an unrelated policy. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework counter. Transfer the rule using a dashboard chooses a translated message for completed questions. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Minimum and maximum fraction digits or significant digits can change the rounded representation used for rule selection.” Apply this procedure: State the contract for Digit options influence selection, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The visible fractional representation can affect plural operands, so formatter and selector options should be designed together. For the homework counter, add one near-miss that exposes formatting with one policy and selecting a message with an unrelated policy. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: reading tracker. Predict the rule using book and page counts use locale-specific cardinal categories. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Minimum and maximum fraction digits or significant digits can change the rounded representation used for rule selection.” Apply this procedure: State the contract for Digit options influence selection, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The visible fractional representation can affect plural operands, so formatter and selector options should be designed together. For the reading tracker, add one near-miss that exposes formatting with one policy and selecting a message with an unrelated policy. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers formatting with one policy and selecting a message with an unrelated policy.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Digit options influence selection, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Digit options influence selection?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing formatting with one policy and selecting a message with an unrelated policy be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny family planner with day ranges choose a range category only when the runtime exposes selectRange. Include one ordinary case, one boundary and one deliberate failure caused by formatting with one policy and selecting a message with an unrelated policy. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Minimum and maximum fraction digits or significant digits can change the rounded representation used for rule selection. It shows a trace, not only a final value. The ordinary case should demonstrate “The visible fractional representation can affect plural operands, so formatter and selector options should be designed together.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Digit options influence selection, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Digit options influence selection, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
resolvedOptions reports the chosen locale, type, digit settings and pluralCategories supported by the resolved rules. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is guessing defaults from another Intl formatter. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for resolvedOptions documents the active policy, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the resolvedOptions documents the active policy chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on guessing defaults from another Intl formatter. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const o=new Intl.PluralRules('pl').resolvedOptions();
console.log(o.type,o.pluralCategories);Explained result. The object exposes its actual policy and category set for testing and message validation. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: homework counter. Explain the rule using a dashboard chooses a translated message for completed questions. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “resolvedOptions reports the chosen locale, type, digit settings and pluralCategories supported by the resolved rules.” Apply this procedure: State the contract for resolvedOptions documents the active policy, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The object exposes its actual policy and category set for testing and message validation. For the homework counter, add one near-miss that exposes guessing defaults from another Intl formatter. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: reading tracker. Transfer the rule using book and page counts use locale-specific cardinal categories. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “resolvedOptions reports the chosen locale, type, digit settings and pluralCategories supported by the resolved rules.” Apply this procedure: State the contract for resolvedOptions documents the active policy, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The object exposes its actual policy and category set for testing and message validation. For the reading tracker, add one near-miss that exposes guessing defaults from another Intl formatter. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: science display. Predict the rule using rounded measurements select a message without rewriting the number. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “resolvedOptions reports the chosen locale, type, digit settings and pluralCategories supported by the resolved rules.” Apply this procedure: State the contract for resolvedOptions documents the active policy, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The object exposes its actual policy and category set for testing and message validation. For the science display, add one near-miss that exposes guessing defaults from another Intl formatter. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: CCA registration. Contrast the rule using place labels use ordinal categories where the locale supports them. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “resolvedOptions reports the chosen locale, type, digit settings and pluralCategories supported by the resolved rules.” Apply this procedure: State the contract for resolvedOptions documents the active policy, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The object exposes its actual policy and category set for testing and message validation. For the CCA registration, add one near-miss that exposes guessing defaults from another Intl formatter. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers guessing defaults from another Intl formatter.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for resolvedOptions documents the active policy, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from resolvedOptions documents the active policy?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing guessing defaults from another Intl formatter be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny library catalogue with a message dictionary covers every reported category and an other fallback. Include one ordinary case, one boundary and one deliberate failure caused by guessing defaults from another Intl formatter. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: resolvedOptions reports the chosen locale, type, digit settings and pluralCategories supported by the resolved rules. It shows a trace, not only a final value. The ordinary case should demonstrate “The object exposes its actual policy and category set for testing and message validation.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for resolvedOptions documents the active policy, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For resolvedOptions documents the active policy, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
The reported pluralCategories array identifies categories the resolved locale may return under the object’s rules. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is shipping a dictionary with only one and other for every language. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for pluralCategories drive dictionary checks, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the pluralCategories drive dictionary checks chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on shipping a dictionary with only one and other for every language. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const cats=new Intl.PluralRules('ar').resolvedOptions().pluralCategories;Explained result. The application can verify that translated patterns cover each reported category plus a defensive other fallback. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: science display. Transfer the rule using rounded measurements select a message without rewriting the number. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The reported pluralCategories array identifies categories the resolved locale may return under the object’s rules.” Apply this procedure: State the contract for pluralCategories drive dictionary checks, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The application can verify that translated patterns cover each reported category plus a defensive other fallback. For the science display, add one near-miss that exposes shipping a dictionary with only one and other for every language. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: CCA registration. Predict the rule using place labels use ordinal categories where the locale supports them. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The reported pluralCategories array identifies categories the resolved locale may return under the object’s rules.” Apply this procedure: State the contract for pluralCategories drive dictionary checks, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The application can verify that translated patterns cover each reported category plus a defensive other fallback. For the CCA registration, add one near-miss that exposes shipping a dictionary with only one and other for every language. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: family planner. Contrast the rule using day ranges choose a range category only when the runtime exposes selectRange. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The reported pluralCategories array identifies categories the resolved locale may return under the object’s rules.” Apply this procedure: State the contract for pluralCategories drive dictionary checks, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The application can verify that translated patterns cover each reported category plus a defensive other fallback. For the family planner, add one near-miss that exposes shipping a dictionary with only one and other for every language. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: library catalogue. Stress-test the rule using a message dictionary covers every reported category and an other fallback. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The reported pluralCategories array identifies categories the resolved locale may return under the object’s rules.” Apply this procedure: State the contract for pluralCategories drive dictionary checks, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The application can verify that translated patterns cover each reported category plus a defensive other fallback. For the library catalogue, add one near-miss that exposes shipping a dictionary with only one and other for every language. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers shipping a dictionary with only one and other for every language.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for pluralCategories drive dictionary checks, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from pluralCategories drive dictionary checks?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing shipping a dictionary with only one and other for every language be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny test laboratory with locales, decimals, negatives, special numbers and unsupported range methods are recorded. Include one ordinary case, one boundary and one deliberate failure caused by shipping a dictionary with only one and other for every language. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: The reported pluralCategories array identifies categories the resolved locale may return under the object’s rules. It shows a trace, not only a final value. The ordinary case should demonstrate “The application can verify that translated patterns cover each reported category plus a defensive other fallback.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for pluralCategories drive dictionary checks, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For pluralCategories drive dictionary checks, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
The static method returns requested locales supported without falling back to the runtime default. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is constructing one object and inferring that every locale in a product is available. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for supportedLocalesOf is a support probe, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the supportedLocalesOf is a support probe chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on constructing one object and inferring that every locale in a product is available. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
Intl.PluralRules.supportedLocalesOf(['en','ar','zz-ZZ'])Explained result. The returned list separates supported requests from an invented or unavailable tag. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: family planner. Predict the rule using day ranges choose a range category only when the runtime exposes selectRange. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The static method returns requested locales supported without falling back to the runtime default.” Apply this procedure: State the contract for supportedLocalesOf is a support probe, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The returned list separates supported requests from an invented or unavailable tag. For the family planner, add one near-miss that exposes constructing one object and inferring that every locale in a product is available. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: library catalogue. Contrast the rule using a message dictionary covers every reported category and an other fallback. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The static method returns requested locales supported without falling back to the runtime default.” Apply this procedure: State the contract for supportedLocalesOf is a support probe, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The returned list separates supported requests from an invented or unavailable tag. For the library catalogue, add one near-miss that exposes constructing one object and inferring that every locale in a product is available. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: test laboratory. Stress-test the rule using locales, decimals, negatives, special numbers and unsupported range methods are recorded. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The static method returns requested locales supported without falling back to the runtime default.” Apply this procedure: State the contract for supportedLocalesOf is a support probe, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The returned list separates supported requests from an invented or unavailable tag. For the test laboratory, add one near-miss that exposes constructing one object and inferring that every locale in a product is available. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: design decision. Explain the rule using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The static method returns requested locales supported without falling back to the runtime default.” Apply this procedure: State the contract for supportedLocalesOf is a support probe, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The returned list separates supported requests from an invented or unavailable tag. For the design decision, add one near-miss that exposes constructing one object and inferring that every locale in a product is available. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers constructing one object and inferring that every locale in a product is available.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for supportedLocalesOf is a support probe, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from supportedLocalesOf is a support probe?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing constructing one object and inferring that every locale in a product is available be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny design decision with PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. Include one ordinary case, one boundary and one deliberate failure caused by constructing one object and inferring that every locale in a product is available. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: The static method returns requested locales supported without falling back to the runtime default. It shows a trace, not only a final value. The ordinary case should demonstrate “The returned list separates supported requests from an invented or unavailable tag.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for supportedLocalesOf is a support probe, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For supportedLocalesOf is a support probe, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 12 OF 20 . Handle boundaries
12. Formatting remains a separate responsibility
NumberFormat formats the visible number while PluralRules selects the message category; their digit policies should align. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is expecting PluralRules to insert grouping, digits or unit text. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Formatting remains a separate responsibility, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Formatting remains a separate responsibility chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on expecting PluralRules to insert grouping, digits or unit text. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const n=1.5;
const text=new Intl.NumberFormat('fr').format(n);
const key=new Intl.PluralRules('fr').select(n);Explained result. text presents the number and key chooses the message; neither substitutes for the other. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: test laboratory. Contrast the rule using locales, decimals, negatives, special numbers and unsupported range methods are recorded. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “NumberFormat formats the visible number while PluralRules selects the message category; their digit policies should align.” Apply this procedure: State the contract for Formatting remains a separate responsibility, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: text presents the number and key chooses the message; neither substitutes for the other. For the test laboratory, add one near-miss that exposes expecting PluralRules to insert grouping, digits or unit text. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: design decision. Stress-test the rule using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “NumberFormat formats the visible number while PluralRules selects the message category; their digit policies should align.” Apply this procedure: State the contract for Formatting remains a separate responsibility, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: text presents the number and key chooses the message; neither substitutes for the other. For the design decision, add one near-miss that exposes expecting PluralRules to insert grouping, digits or unit text. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework counter. Explain the rule using a dashboard chooses a translated message for completed questions. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “NumberFormat formats the visible number while PluralRules selects the message category; their digit policies should align.” Apply this procedure: State the contract for Formatting remains a separate responsibility, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: text presents the number and key chooses the message; neither substitutes for the other. For the homework counter, add one near-miss that exposes expecting PluralRules to insert grouping, digits or unit text. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: reading tracker. Transfer the rule using book and page counts use locale-specific cardinal categories. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “NumberFormat formats the visible number while PluralRules selects the message category; their digit policies should align.” Apply this procedure: State the contract for Formatting remains a separate responsibility, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: text presents the number and key chooses the message; neither substitutes for the other. For the reading tracker, add one near-miss that exposes expecting PluralRules to insert grouping, digits or unit text. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers expecting PluralRules to insert grouping, digits or unit text.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Formatting remains a separate responsibility, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Formatting remains a separate responsibility?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing expecting PluralRules to insert grouping, digits or unit text be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework counter with a dashboard chooses a translated message for completed questions. Include one ordinary case, one boundary and one deliberate failure caused by expecting PluralRules to insert grouping, digits or unit text. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: NumberFormat formats the visible number while PluralRules selects the message category; their digit policies should align. It shows a trace, not only a final value. The ordinary case should demonstrate “text presents the number and key chooses the message; neither substitutes for the other.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Formatting remains a separate responsibility, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Formatting remains a separate responsibility, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Category sets vary by locale, and other is the durable fallback when a specific pattern is unavailable. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is letting a missing category render undefined to families. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Every map needs an other fallback, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Every map needs an other fallback chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on letting a missing category render undefined to families. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const msg=messages[key] ?? messages.other;Explained result. The lookup produces a defined fallback while translation validation can still report missing categories. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: homework counter. Stress-test the rule using a dashboard chooses a translated message for completed questions. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Category sets vary by locale, and other is the durable fallback when a specific pattern is unavailable.” Apply this procedure: State the contract for Every map needs an other fallback, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The lookup produces a defined fallback while translation validation can still report missing categories. For the homework counter, add one near-miss that exposes letting a missing category render undefined to families. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: reading tracker. Explain the rule using book and page counts use locale-specific cardinal categories. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Category sets vary by locale, and other is the durable fallback when a specific pattern is unavailable.” Apply this procedure: State the contract for Every map needs an other fallback, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The lookup produces a defined fallback while translation validation can still report missing categories. For the reading tracker, add one near-miss that exposes letting a missing category render undefined to families. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: science display. Transfer the rule using rounded measurements select a message without rewriting the number. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Category sets vary by locale, and other is the durable fallback when a specific pattern is unavailable.” Apply this procedure: State the contract for Every map needs an other fallback, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The lookup produces a defined fallback while translation validation can still report missing categories. For the science display, add one near-miss that exposes letting a missing category render undefined to families. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: CCA registration. Predict the rule using place labels use ordinal categories where the locale supports them. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Category sets vary by locale, and other is the durable fallback when a specific pattern is unavailable.” Apply this procedure: State the contract for Every map needs an other fallback, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The lookup produces a defined fallback while translation validation can still report missing categories. For the CCA registration, add one near-miss that exposes letting a missing category render undefined to families. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers letting a missing category render undefined to families.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Every map needs an other fallback, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Every map needs an other fallback?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing letting a missing category render undefined to families be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny reading tracker with book and page counts use locale-specific cardinal categories. Include one ordinary case, one boundary and one deliberate failure caused by letting a missing category render undefined to families. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Category sets vary by locale, and other is the durable fallback when a specific pattern is unavailable. It shows a trace, not only a final value. The ordinary case should demonstrate “The lookup produces a defined fallback while translation validation can still report missing categories.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Every map needs an other fallback, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Every map needs an other fallback, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 14 OF 20 . Debug and verify
14. Locales can classify the same number differently
Two locales may return different categories for the same numeric input because their grammatical rules differ. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is copying an English conditional into another locale. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Locales can classify the same number differently, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Locales can classify the same number differently chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on copying an English conditional into another locale. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
for(const l of ['en','fr','ar']) console.log(l,new Intl.PluralRules(l).select(0));Explained result. The observed categories differ, proving that locale data rather than English intuition must drive selection. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: science display. Explain the rule using rounded measurements select a message without rewriting the number. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Two locales may return different categories for the same numeric input because their grammatical rules differ.” Apply this procedure: State the contract for Locales can classify the same number differently, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The observed categories differ, proving that locale data rather than English intuition must drive selection. For the science display, add one near-miss that exposes copying an English conditional into another locale. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: CCA registration. Transfer the rule using place labels use ordinal categories where the locale supports them. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Two locales may return different categories for the same numeric input because their grammatical rules differ.” Apply this procedure: State the contract for Locales can classify the same number differently, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The observed categories differ, proving that locale data rather than English intuition must drive selection. For the CCA registration, add one near-miss that exposes copying an English conditional into another locale. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: family planner. Predict the rule using day ranges choose a range category only when the runtime exposes selectRange. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Two locales may return different categories for the same numeric input because their grammatical rules differ.” Apply this procedure: State the contract for Locales can classify the same number differently, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The observed categories differ, proving that locale data rather than English intuition must drive selection. For the family planner, add one near-miss that exposes copying an English conditional into another locale. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: library catalogue. Contrast the rule using a message dictionary covers every reported category and an other fallback. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Two locales may return different categories for the same numeric input because their grammatical rules differ.” Apply this procedure: State the contract for Locales can classify the same number differently, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The observed categories differ, proving that locale data rather than English intuition must drive selection. For the library catalogue, add one near-miss that exposes copying an English conditional into another locale. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers copying an English conditional into another locale.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Locales can classify the same number differently, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Locales can classify the same number differently?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing copying an English conditional into another locale be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny science display with rounded measurements select a message without rewriting the number. Include one ordinary case, one boundary and one deliberate failure caused by copying an English conditional into another locale. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Two locales may return different categories for the same numeric input because their grammatical rules differ. It shows a trace, not only a final value. The ordinary case should demonstrate “The observed categories differ, proving that locale data rather than English intuition must drive selection.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Locales can classify the same number differently, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Locales can classify the same number differently, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Ordinal categories can select complete phrases or suffix patterns, but the correct form is language-specific. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is concatenating English suffixes after a number in every locale. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Ordinal labels need full message patterns, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Ordinal labels need full message patterns chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on concatenating English suffixes after a number in every locale. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const key=new Intl.PluralRules('en',{type:'ordinal'}).select(23);Explained result. English 23 selects few, but another locale may expose only other or require a different phrase structure. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: family planner. Transfer the rule using day ranges choose a range category only when the runtime exposes selectRange. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Ordinal categories can select complete phrases or suffix patterns, but the correct form is language-specific.” Apply this procedure: State the contract for Ordinal labels need full message patterns, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English 23 selects few, but another locale may expose only other or require a different phrase structure. For the family planner, add one near-miss that exposes concatenating English suffixes after a number in every locale. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: library catalogue. Predict the rule using a message dictionary covers every reported category and an other fallback. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Ordinal categories can select complete phrases or suffix patterns, but the correct form is language-specific.” Apply this procedure: State the contract for Ordinal labels need full message patterns, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English 23 selects few, but another locale may expose only other or require a different phrase structure. For the library catalogue, add one near-miss that exposes concatenating English suffixes after a number in every locale. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: test laboratory. Contrast the rule using locales, decimals, negatives, special numbers and unsupported range methods are recorded. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Ordinal categories can select complete phrases or suffix patterns, but the correct form is language-specific.” Apply this procedure: State the contract for Ordinal labels need full message patterns, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English 23 selects few, but another locale may expose only other or require a different phrase structure. For the test laboratory, add one near-miss that exposes concatenating English suffixes after a number in every locale. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: design decision. Stress-test the rule using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Ordinal categories can select complete phrases or suffix patterns, but the correct form is language-specific.” Apply this procedure: State the contract for Ordinal labels need full message patterns, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: English 23 selects few, but another locale may expose only other or require a different phrase structure. For the design decision, add one near-miss that exposes concatenating English suffixes after a number in every locale. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers concatenating English suffixes after a number in every locale.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Ordinal labels need full message patterns, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Ordinal labels need full message patterns?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing concatenating English suffixes after a number in every locale be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny CCA registration with place labels use ordinal categories where the locale supports them. Include one ordinary case, one boundary and one deliberate failure caused by concatenating English suffixes after a number in every locale. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Ordinal categories can select complete phrases or suffix patterns, but the correct form is language-specific. It shows a trace, not only a final value. The ordinary case should demonstrate “English 23 selects few, but another locale may expose only other or require a different phrase structure.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Ordinal labels need full message patterns, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Ordinal labels need full message patterns, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
select converts its input to Number; NaN, Infinity and negative values therefore need an application policy and observed runtime tests. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is allowing nonsensical counts into user-facing messages because select still returns a category. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Special numeric inputs need tests, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Special numeric inputs need tests chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on allowing nonsensical counts into user-facing messages because select still returns a category. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const pr=new Intl.PluralRules('en');
[NaN,Infinity,-1].map(x=>pr.select(x))Explained result. A category result does not make the domain value valid; validate counts before message selection. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: test laboratory. Predict the rule using locales, decimals, negatives, special numbers and unsupported range methods are recorded. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “select converts its input to Number; NaN, Infinity and negative values therefore need an application policy and observed runtime tests.” Apply this procedure: State the contract for Special numeric inputs need tests, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: A category result does not make the domain value valid; validate counts before message selection. For the test laboratory, add one near-miss that exposes allowing nonsensical counts into user-facing messages because select still returns a category. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: design decision. Contrast the rule using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “select converts its input to Number; NaN, Infinity and negative values therefore need an application policy and observed runtime tests.” Apply this procedure: State the contract for Special numeric inputs need tests, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: A category result does not make the domain value valid; validate counts before message selection. For the design decision, add one near-miss that exposes allowing nonsensical counts into user-facing messages because select still returns a category. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework counter. Stress-test the rule using a dashboard chooses a translated message for completed questions. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “select converts its input to Number; NaN, Infinity and negative values therefore need an application policy and observed runtime tests.” Apply this procedure: State the contract for Special numeric inputs need tests, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: A category result does not make the domain value valid; validate counts before message selection. For the homework counter, add one near-miss that exposes allowing nonsensical counts into user-facing messages because select still returns a category. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: reading tracker. Explain the rule using book and page counts use locale-specific cardinal categories. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “select converts its input to Number; NaN, Infinity and negative values therefore need an application policy and observed runtime tests.” Apply this procedure: State the contract for Special numeric inputs need tests, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: A category result does not make the domain value valid; validate counts before message selection. For the reading tracker, add one near-miss that exposes allowing nonsensical counts into user-facing messages because select still returns a category. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers allowing nonsensical counts into user-facing messages because select still returns a category.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Special numeric inputs need tests, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Special numeric inputs need tests?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing allowing nonsensical counts into user-facing messages because select still returns a category be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny family planner with day ranges choose a range category only when the runtime exposes selectRange. Include one ordinary case, one boundary and one deliberate failure caused by allowing nonsensical counts into user-facing messages because select still returns a category. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: select converts its input to Number; NaN, Infinity and negative values therefore need an application policy and observed runtime tests. It shows a trace, not only a final value. The ordinary case should demonstrate “A category result does not make the domain value valid; validate counts before message selection.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Special numeric inputs need tests, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Special numeric inputs need tests, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Current ECMA-402 defines selectRange(start,end), but not every deployed engine necessarily implements it. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is calling selectRange unguarded because a current specification includes it. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for selectRange is capability-sensitive, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the selectRange is capability-sensitive chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on calling selectRange unguarded because a current specification includes it. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
if(typeof pr.selectRange==='function') console.log(pr.selectRange(1,2));Explained result. The capability check protects older runtimes; a documented product fallback is still required. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: homework counter. Contrast the rule using a dashboard chooses a translated message for completed questions. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Current ECMA-402 defines selectRange(start,end), but not every deployed engine necessarily implements it.” Apply this procedure: State the contract for selectRange is capability-sensitive, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The capability check protects older runtimes; a documented product fallback is still required. For the homework counter, add one near-miss that exposes calling selectRange unguarded because a current specification includes it. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: reading tracker. Stress-test the rule using book and page counts use locale-specific cardinal categories. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Current ECMA-402 defines selectRange(start,end), but not every deployed engine necessarily implements it.” Apply this procedure: State the contract for selectRange is capability-sensitive, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The capability check protects older runtimes; a documented product fallback is still required. For the reading tracker, add one near-miss that exposes calling selectRange unguarded because a current specification includes it. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: science display. Explain the rule using rounded measurements select a message without rewriting the number. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Current ECMA-402 defines selectRange(start,end), but not every deployed engine necessarily implements it.” Apply this procedure: State the contract for selectRange is capability-sensitive, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The capability check protects older runtimes; a documented product fallback is still required. For the science display, add one near-miss that exposes calling selectRange unguarded because a current specification includes it. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: CCA registration. Transfer the rule using place labels use ordinal categories where the locale supports them. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Current ECMA-402 defines selectRange(start,end), but not every deployed engine necessarily implements it.” Apply this procedure: State the contract for selectRange is capability-sensitive, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The capability check protects older runtimes; a documented product fallback is still required. For the CCA registration, add one near-miss that exposes calling selectRange unguarded because a current specification includes it. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers calling selectRange unguarded because a current specification includes it.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for selectRange is capability-sensitive, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from selectRange is capability-sensitive?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing calling selectRange unguarded because a current specification includes it be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny library catalogue with a message dictionary covers every reported category and an other fallback. Include one ordinary case, one boundary and one deliberate failure caused by calling selectRange unguarded because a current specification includes it. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Current ECMA-402 defines selectRange(start,end), but not every deployed engine necessarily implements it. It shows a trace, not only a final value. The ordinary case should demonstrate “The capability check protects older runtimes; a documented product fallback is still required.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for selectRange is capability-sensitive, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For selectRange is capability-sensitive, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
The object supplies no noun, inflection table or translation service. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using the category name itself as visible text. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for PluralRules does not translate words, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the PluralRules does not translate words chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using the category name itself as visible text. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const pattern=messages[pr.select(count)] ?? messages.other;Explained result. Human-authored localized patterns supply grammar and vocabulary; the category is only a selection key. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: science display. Stress-test the rule using rounded measurements select a message without rewriting the number. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The object supplies no noun, inflection table or translation service.” Apply this procedure: State the contract for PluralRules does not translate words, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Human-authored localized patterns supply grammar and vocabulary; the category is only a selection key. For the science display, add one near-miss that exposes using the category name itself as visible text. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: CCA registration. Explain the rule using place labels use ordinal categories where the locale supports them. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The object supplies no noun, inflection table or translation service.” Apply this procedure: State the contract for PluralRules does not translate words, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Human-authored localized patterns supply grammar and vocabulary; the category is only a selection key. For the CCA registration, add one near-miss that exposes using the category name itself as visible text. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: family planner. Transfer the rule using day ranges choose a range category only when the runtime exposes selectRange. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The object supplies no noun, inflection table or translation service.” Apply this procedure: State the contract for PluralRules does not translate words, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Human-authored localized patterns supply grammar and vocabulary; the category is only a selection key. For the family planner, add one near-miss that exposes using the category name itself as visible text. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: library catalogue. Predict the rule using a message dictionary covers every reported category and an other fallback. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The object supplies no noun, inflection table or translation service.” Apply this procedure: State the contract for PluralRules does not translate words, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Human-authored localized patterns supply grammar and vocabulary; the category is only a selection key. For the library catalogue, add one near-miss that exposes using the category name itself as visible text. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using the category name itself as visible text.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for PluralRules does not translate words, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from PluralRules does not translate words?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using the category name itself as visible text be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny test laboratory with locales, decimals, negatives, special numbers and unsupported range methods are recorded. Include one ordinary case, one boundary and one deliberate failure caused by using the category name itself as visible text. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: The object supplies no noun, inflection table or translation service. It shows a trace, not only a final value. The ordinary case should demonstrate “Human-authored localized patterns supply grammar and vocabulary; the category is only a selection key.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for PluralRules does not translate words, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For PluralRules does not translate words, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Tests should cover every supported locale, reported category, relevant digit policy and boundary value. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is approving an interface after checking only English 1 and 2. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for A matrix is stronger than one example, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the A matrix is stronger than one example chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on approving an interface after checking only English 1 and 2. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
for(const locale of locales){
const pr=new Intl.PluralRules(locale,options);
console.log(locale,pr.resolvedOptions().pluralCategories);
}Explained result. The matrix exposes missing patterns and policy mismatches before families encounter them. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: family planner. Explain the rule using day ranges choose a range category only when the runtime exposes selectRange. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Tests should cover every supported locale, reported category, relevant digit policy and boundary value.” Apply this procedure: State the contract for A matrix is stronger than one example, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The matrix exposes missing patterns and policy mismatches before families encounter them. For the family planner, add one near-miss that exposes approving an interface after checking only English 1 and 2. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: library catalogue. Transfer the rule using a message dictionary covers every reported category and an other fallback. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Tests should cover every supported locale, reported category, relevant digit policy and boundary value.” Apply this procedure: State the contract for A matrix is stronger than one example, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The matrix exposes missing patterns and policy mismatches before families encounter them. For the library catalogue, add one near-miss that exposes approving an interface after checking only English 1 and 2. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: test laboratory. Predict the rule using locales, decimals, negatives, special numbers and unsupported range methods are recorded. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Tests should cover every supported locale, reported category, relevant digit policy and boundary value.” Apply this procedure: State the contract for A matrix is stronger than one example, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The matrix exposes missing patterns and policy mismatches before families encounter them. For the test laboratory, add one near-miss that exposes approving an interface after checking only English 1 and 2. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: design decision. Contrast the rule using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Tests should cover every supported locale, reported category, relevant digit policy and boundary value.” Apply this procedure: State the contract for A matrix is stronger than one example, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The matrix exposes missing patterns and policy mismatches before families encounter them. For the design decision, add one near-miss that exposes approving an interface after checking only English 1 and 2. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers approving an interface after checking only English 1 and 2.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for A matrix is stronger than one example, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from A matrix is stronger than one example?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing approving an interface after checking only English 1 and 2 be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny design decision with PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. Include one ordinary case, one boundary and one deliberate failure caused by approving an interface after checking only English 1 and 2. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Tests should cover every supported locale, reported category, relevant digit policy and boundary value. It shows a trace, not only a final value. The ordinary case should demonstrate “The matrix exposes missing patterns and policy mismatches before families encounter them.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for A matrix is stronger than one example, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For A matrix is stronger than one example, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 20 OF 20 . Transfer with judgment
20. Cache by locale and options, then choose deliberately
Intl objects can be reused for repeated selections when their locale and options are identical; use them for localized messages, not mathematical branching. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is constructing a new object per table cell or replacing domain validation with grammar categories. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Cache by locale and options, then choose deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Cache by locale and options, then choose deliberately chapter on JavaScript Intl.PluralRules, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on constructing a new object per table cell or replacing domain validation with grammar categories. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const cache=new Map();
function rules(key,make){if(!cache.has(key))cache.set(key,make());return cache.get(key)}Explained result. Reuse is safe for the same immutable configuration, while validation and arithmetic remain separate application jobs. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: test laboratory. Transfer the rule using locales, decimals, negatives, special numbers and unsupported range methods are recorded. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Intl objects can be reused for repeated selections when their locale and options are identical; use them for localized messages, not mathematical branching.” Apply this procedure: State the contract for Cache by locale and options, then choose deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Reuse is safe for the same immutable configuration, while validation and arithmetic remain separate application jobs. For the test laboratory, add one near-miss that exposes constructing a new object per table cell or replacing domain validation with grammar categories. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: design decision. Predict the rule using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Intl objects can be reused for repeated selections when their locale and options are identical; use them for localized messages, not mathematical branching.” Apply this procedure: State the contract for Cache by locale and options, then choose deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Reuse is safe for the same immutable configuration, while validation and arithmetic remain separate application jobs. For the design decision, add one near-miss that exposes constructing a new object per table cell or replacing domain validation with grammar categories. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework counter. Contrast the rule using a dashboard chooses a translated message for completed questions. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Intl objects can be reused for repeated selections when their locale and options are identical; use them for localized messages, not mathematical branching.” Apply this procedure: State the contract for Cache by locale and options, then choose deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Reuse is safe for the same immutable configuration, while validation and arithmetic remain separate application jobs. For the homework counter, add one near-miss that exposes constructing a new object per table cell or replacing domain validation with grammar categories. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: reading tracker. Stress-test the rule using book and page counts use locale-specific cardinal categories. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Intl objects can be reused for repeated selections when their locale and options are identical; use them for localized messages, not mathematical branching.” Apply this procedure: State the contract for Cache by locale and options, then choose deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Reuse is safe for the same immutable configuration, while validation and arithmetic remain separate application jobs. For the reading tracker, add one near-miss that exposes constructing a new object per table cell or replacing domain validation with grammar categories. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers constructing a new object per table cell or replacing domain validation with grammar categories.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Cache by locale and options, then choose deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final JavaScript Intl.PluralRules syntax. For this chapter, useful prompts are: “What did you expect from Cache by locale and options, then choose deliberately?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing constructing a new object per table cell or replacing domain validation with grammar categories be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework counter with a dashboard chooses a translated message for completed questions. Include one ordinary case, one boundary and one deliberate failure caused by constructing a new object per table cell or replacing domain validation with grammar categories. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Intl objects can be reused for repeated selections when their locale and options are identical; use them for localized messages, not mathematical branching. It shows a trace, not only a final value. The ordinary case should demonstrate “Reuse is safe for the same immutable configuration, while validation and arithmetic remain separate application jobs.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Cache by locale and options, then choose deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Cache by locale and options, then choose deliberately, separate the documented JavaScript Intl.PluralRules mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Parent guide: choose the next useful step
Start with evidence, not a label such as careless. Ask for one prediction and one trace. If the first transition is wrong, rebuild the model. If the model is sound but syntax fails, practise reference use. If routine cases are correct but boundaries fail, vary ties, defaults, unsupported inputs, ownership or missing paths. If explanations transfer, move to a small project.
Keep a weekly record with four lines: concept, prediction, observed difference and next test. Stop when fatigue replaces reasoning. A smaller case tomorrow is more useful than another hour of copying tonight.
Seek specialist help when cause and effect remain invisible after examples are reduced, when accessibility or data-loss implications are unclear, or when an important repository, database or application state may be at risk. Good support should make the learner’s reasoning more independent.
Capstone practice with explained routes
1. homework counter: model, boundary and recovery
Create a small homework counter using a dashboard chooses a translated message for completed questions. Combine “Plural categories are grammatical selectors” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: PluralRules maps a numeric input to a locale rule category; it does not translate nouns or assemble a sentence. Apply: State the contract for Plural categories are grammatical selectors, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: English cardinal rules return one then other, but the application still chooses complete message patterns. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
2. reading tracker: model, boundary and recovery
Create a small reading tracker using book and page counts use locale-specific cardinal categories. Combine “Ordinal rules are explicit” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: type ordinal selects rules intended for ordinal positions when the locale defines distinctions. Apply: State the contract for Ordinal rules are explicit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: English produces one, two, few, other for these positions, which can map to complete localized ordinal messages. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
3. science display: model, boundary and recovery
Create a small science display using rounded measurements select a message without rewriting the number. Combine “Decimals can follow different rules” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: Fractional operands participate in locale plural rules and may select a different category from nearby integers. Apply: State the contract for Decimals can follow different rules, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: English cardinal selection treats 1 as one while 1.2 and 2 select other. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
4. CCA registration: model, boundary and recovery
Create a small CCA registration using place labels use ordinal categories where the locale supports them. Combine “pluralCategories drive dictionary checks” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: The reported pluralCategories array identifies categories the resolved locale may return under the object’s rules. Apply: State the contract for pluralCategories drive dictionary checks, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The application can verify that translated patterns cover each reported category plus a defensive other fallback. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
5. family planner: model, boundary and recovery
Create a small family planner using day ranges choose a range category only when the runtime exposes selectRange. Combine “Every map needs an other fallback” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: Category sets vary by locale, and other is the durable fallback when a specific pattern is unavailable. Apply: State the contract for Every map needs an other fallback, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The lookup produces a defined fallback while translation validation can still report missing categories. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
6. library catalogue: model, boundary and recovery
Create a small library catalogue using a message dictionary covers every reported category and an other fallback. Combine “Special numeric inputs need tests” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: select converts its input to Number; NaN, Infinity and negative values therefore need an application policy and observed runtime tests. Apply: State the contract for Special numeric inputs need tests, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: A category result does not make the domain value valid; validate counts before message selection. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
7. test laboratory: model, boundary and recovery
Create a small test laboratory using locales, decimals, negatives, special numbers and unsupported range methods are recorded. Combine “A matrix is stronger than one example” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: Tests should cover every supported locale, reported category, relevant digit policy and boundary value. Apply: State the contract for A matrix is stronger than one example, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The matrix exposes missing patterns and policy mismatches before families encounter them. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
8. design decision: model, boundary and recovery
Create a small design decision using PluralRules is compared with NumberFormat, ListFormat and hand-written English-only branching. Combine “The constructor negotiates locale” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: The requested locale list is resolved against locale data available in the implementation. Apply: State the contract for The constructor negotiates locale, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: resolvedOptions reveals the locale actually selected by the runtime. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
Frequently asked questions
How long should a practice session be?
Use one complete prediction–observation–explanation cycle while attention remains good. Ten to twenty focused minutes can be enough.
Should every option or function be memorised?
No. Memorise the governing distinctions and practise retrieving the official reference. Understanding means predicting and explaining, not reciting a parameter list.
What if the result is correct but the explanation is weak?
Treat it as partial success. Ask for a trace and change one boundary. A reliable model survives controlled variation.
Is the shortest solution the best?
Not automatically. Prefer the solution whose semantics, failure modes and maintenance cost are easiest to justify for the actual project.
When should official documentation be used?
Use it whenever syntax, supported types, SQL dialect behaviour or Git version details matter. Primary documentation settles the current contract.
How can a parent help without technical expertise?
Ask what was predicted, where the first difference appeared, what evidence matters and which smaller example could isolate it.
How do we test transfer?
Change the context, vocabulary and one boundary. Require the learner to identify the invariant before using a tool.
What should be saved after practice?
Keep the corrected rule, one trace, one boundary case and the next question. Avoid storing pages of unexplained output.
Can these exercises replace backups?
No. Use disposable examples and proper backups. Learning should not endanger schoolwork, repositories or personal data.
What counts as mastery?
The learner can predict, verify, diagnose, recover and justify a choice across more than one context, while knowing when to consult the current reference.

