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.ListFormat turns an iterable of strings into a locale-sensitive list. The formatter selects conjunction, disjunction or unit patterns, combines pair, start, middle and end templates, and can expose element and literal parts for structured rendering. Mastery means keeping data order separate from presentation, choosing a real locale and semantic list type, understanding long, short and narrow styles, validating string input, using formatToParts() instead of parsing punctuation, and retaining accessible meaning when visual styling is added. 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
Intl.ListFormat formats an already chosen ordered list of strings; it does not sort, translate, deduplicate or validate domain meaning. 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 passing raw records and expecting the formatter to choose useful labels and order. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Prepare the semantic strings first, freeze their order, then call the formatter only at the presentation boundary.
For the ListFormat is a presentation service chapter on JavaScript Intl.ListFormat, 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 passing raw records and expecting the formatter to choose useful labels and order. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const lf=new Intl.ListFormat('en-SG');
console.log(lf.format(['Math','Science','English']));Explained result. The returned string uses the resolved locale list pattern while preserving the supplied element order. 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 dashboard. Predict the rule using three subjects that have tasks due today. 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.ListFormat formats an already chosen ordered list of strings; it does not sort, translate, deduplicate or validate domain meaning.” Apply this procedure: Prepare the semantic strings first, freeze their order, then call the formatter only at the presentation boundary. The expected mechanism is: The returned string uses the resolved locale list pattern while preserving the supplied element order. For the homework dashboard, add one near-miss that exposes passing raw records and expecting the formatter to choose useful labels and order. 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 authors chosen from a user-controlled string list. 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.ListFormat formats an already chosen ordered list of strings; it does not sort, translate, deduplicate or validate domain meaning.” Apply this procedure: Prepare the semantic strings first, freeze their order, then call the formatter only at the presentation boundary. The expected mechanism is: The returned string uses the resolved locale list pattern while preserving the supplied element order. For the reading tracker, add one near-miss that exposes passing raw records and expecting the formatter to choose useful labels and order. 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 project. Stress-test the rule using materials displayed as a conjunction and alternatives as a disjunction. 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.ListFormat formats an already chosen ordered list of strings; it does not sort, translate, deduplicate or validate domain meaning.” Apply this procedure: Prepare the semantic strings first, freeze their order, then call the formatter only at the presentation boundary. The expected mechanism is: The returned string uses the resolved locale list pattern while preserving the supplied element order. For the science project, add one near-miss that exposes passing raw records and expecting the formatter to choose useful labels and order. 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 available weekdays rendered in the family interface locale. 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.ListFormat formats an already chosen ordered list of strings; it does not sort, translate, deduplicate or validate domain meaning.” Apply this procedure: Prepare the semantic strings first, freeze their order, then call the formatter only at the presentation boundary. The expected mechanism is: The returned string uses the resolved locale list pattern while preserving the supplied element order. For the CCA registration, add one near-miss that exposes passing raw records and expecting the formatter to choose useful labels and order. 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 passing raw records and expecting the formatter to choose useful labels and order.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Prepare the semantic strings first, freeze their order, then call the formatter only at the presentation boundary.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from ListFormat is a presentation service?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing passing raw records and expecting the formatter to choose useful labels and order 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 genres shown as compact metadata without inventing punctuation. Include one ordinary case, one boundary and one deliberate failure caused by passing raw records and expecting the formatter to choose useful labels and order. 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.ListFormat formats an already chosen ordered list of strings; it does not sort, translate, deduplicate or validate domain meaning. It shows a trace, not only a final value. The ordinary case should demonstrate “The returned string uses the resolved locale list pattern while preserving the supplied element order.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Prepare the semantic strings first, freeze their order, then call the formatter only at the presentation boundary. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For ListFormat is a presentation service, separate the documented JavaScript Intl.ListFormat 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
Intl.ListFormat is a service constructor and must be called with new; locale negotiation resolves from the requested locale priority list. 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 it as a plain function or letting a server default silently define punctuation and wording. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Pass the interface locale deliberately and inspect resolvedOptions() in tests.
For the Construct with new and an explicit locale chapter on JavaScript Intl.ListFormat, 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 it as a plain function or letting a server default silently define punctuation and wording. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const lf=new Intl.ListFormat(['en-SG','en'],{type:'conjunction'});Explained result. A formatter is constructed with one supported resolved locale chosen from the request and implementation data. 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 project. Contrast the rule using materials displayed as a conjunction and alternatives as a disjunction. 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.ListFormat is a service constructor and must be called with new; locale negotiation resolves from the requested locale priority list.” Apply this procedure: Pass the interface locale deliberately and inspect resolvedOptions() in tests. The expected mechanism is: A formatter is constructed with one supported resolved locale chosen from the request and implementation data. For the science project, add one near-miss that exposes calling it as a plain function or letting a server default silently define punctuation and wording. 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 available weekdays rendered in the family interface locale. 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.ListFormat is a service constructor and must be called with new; locale negotiation resolves from the requested locale priority list.” Apply this procedure: Pass the interface locale deliberately and inspect resolvedOptions() in tests. The expected mechanism is: A formatter is constructed with one supported resolved locale chosen from the request and implementation data. For the CCA registration, add one near-miss that exposes calling it as a plain function or letting a server default silently define punctuation and wording. 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 participants whose names must keep their original order. 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.ListFormat is a service constructor and must be called with new; locale negotiation resolves from the requested locale priority list.” Apply this procedure: Pass the interface locale deliberately and inspect resolvedOptions() in tests. The expected mechanism is: A formatter is constructed with one supported resolved locale chosen from the request and implementation data. For the family planner, add one near-miss that exposes calling it as a plain function or letting a server default silently define punctuation and wording. 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 genres shown as compact metadata without inventing punctuation. 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.ListFormat is a service constructor and must be called with new; locale negotiation resolves from the requested locale priority list.” Apply this procedure: Pass the interface locale deliberately and inspect resolvedOptions() in tests. The expected mechanism is: A formatter is constructed with one supported resolved locale chosen from the request and implementation data. For the library catalogue, add one near-miss that exposes calling it as a plain function or letting a server default silently define punctuation and wording. 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 it as a plain function or letting a server default silently define punctuation and wording.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Pass the interface locale deliberately and inspect resolvedOptions() in tests.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Construct with new and an explicit locale?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing calling it as a plain function or letting a server default silently define punctuation and wording 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 zero, one, two and many elements across locales, types and styles. Include one ordinary case, one boundary and one deliberate failure caused by calling it as a plain function or letting a server default silently define punctuation and wording. 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.ListFormat is a service constructor and must be called with new; locale negotiation resolves from the requested locale priority list. It shows a trace, not only a final value. The ordinary case should demonstrate “A formatter is constructed with one supported resolved locale chosen from the request and implementation data.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Pass the interface locale deliberately and inspect resolvedOptions() in tests. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Construct with new and an explicit locale, separate the documented JavaScript Intl.ListFormat 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 default type is conjunction, selecting locale data for an and-like relationship rather than inserting one fixed English word. 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 joining with comma-space and appending & before the last item in every language. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Set type conjunction and test two and three items in every supported interface locale.
For the Conjunction means an and-based list chapter on JavaScript Intl.ListFormat, 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 joining with comma-space and appending & before the last item in every language. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
new Intl.ListFormat('en-SG',{type:'conjunction'}).format(['A','B','C'])Explained result. The formatter applies the locale conjunction templates, including the locale decision about separators and the final connective. 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 participants whose names must keep their original order. 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 default type is conjunction, selecting locale data for an and-like relationship rather than inserting one fixed English word.” Apply this procedure: Set type conjunction and test two and three items in every supported interface locale. The expected mechanism is: The formatter applies the locale conjunction templates, including the locale decision about separators and the final connective. For the family planner, add one near-miss that exposes joining with comma-space and appending & before the last item in 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: library catalogue. Explain the rule using genres shown as compact metadata without inventing punctuation. 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 default type is conjunction, selecting locale data for an and-like relationship rather than inserting one fixed English word.” Apply this procedure: Set type conjunction and test two and three items in every supported interface locale. The expected mechanism is: The formatter applies the locale conjunction templates, including the locale decision about separators and the final connective. For the library catalogue, add one near-miss that exposes joining with comma-space and appending & before the last item in 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: test laboratory. Transfer the rule using zero, one, two and many elements across locales, types and styles. 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 default type is conjunction, selecting locale data for an and-like relationship rather than inserting one fixed English word.” Apply this procedure: Set type conjunction and test two and three items in every supported interface locale. The expected mechanism is: The formatter applies the locale conjunction templates, including the locale decision about separators and the final connective. For the test laboratory, add one near-miss that exposes joining with comma-space and appending & before the last item in 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: design decision. Predict the rule using ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. 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 default type is conjunction, selecting locale data for an and-like relationship rather than inserting one fixed English word.” Apply this procedure: Set type conjunction and test two and three items in every supported interface locale. The expected mechanism is: The formatter applies the locale conjunction templates, including the locale decision about separators and the final connective. For the design decision, add one near-miss that exposes joining with comma-space and appending & before the last item in 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 joining with comma-space and appending & before the last item in every language.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Set type conjunction and test two and three items in every supported interface locale.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Conjunction means an and-based list?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing joining with comma-space and appending & before the last item in every language 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. Include one ordinary case, one boundary and one deliberate failure caused by joining with comma-space and appending & before the last item in 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 default type is conjunction, selecting locale data for an and-like relationship rather than inserting one fixed English word. It shows a trace, not only a final value. The ordinary case should demonstrate “The formatter applies the locale conjunction templates, including the locale decision about separators and the final connective.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Set type conjunction and test two and three items in every supported interface locale. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Conjunction means an and-based list, separate the documented JavaScript Intl.ListFormat 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 disjunction selects patterns for alternatives, choices or acceptable substitutes. 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 conjunction formatting for choices and changing the meaning from any option to all items. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State whether the list means together or alternatively before selecting the type.
For the Disjunction means an or-based list chapter on JavaScript Intl.ListFormat, 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 conjunction formatting for choices and changing the meaning from any option to all items. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
new Intl.ListFormat('en-SG',{type:'disjunction'}).format(['bus','train','walk'])Explained result. The output communicates alternatives with locale-sensitive or-style wording. 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 zero, one, two and many elements across locales, types and styles. 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 disjunction selects patterns for alternatives, choices or acceptable substitutes.” Apply this procedure: State whether the list means together or alternatively before selecting the type. The expected mechanism is: The output communicates alternatives with locale-sensitive or-style wording. For the test laboratory, add one near-miss that exposes using conjunction formatting for choices and changing the meaning from any option to all items. 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. 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 disjunction selects patterns for alternatives, choices or acceptable substitutes.” Apply this procedure: State whether the list means together or alternatively before selecting the type. The expected mechanism is: The output communicates alternatives with locale-sensitive or-style wording. For the design decision, add one near-miss that exposes using conjunction formatting for choices and changing the meaning from any option to all items. 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 dashboard. Predict the rule using three subjects that have tasks due today. 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 disjunction selects patterns for alternatives, choices or acceptable substitutes.” Apply this procedure: State whether the list means together or alternatively before selecting the type. The expected mechanism is: The output communicates alternatives with locale-sensitive or-style wording. For the homework dashboard, add one near-miss that exposes using conjunction formatting for choices and changing the meaning from any option to all items. 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 authors chosen from a user-controlled string list. 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 disjunction selects patterns for alternatives, choices or acceptable substitutes.” Apply this procedure: State whether the list means together or alternatively before selecting the type. The expected mechanism is: The output communicates alternatives with locale-sensitive or-style wording. For the reading tracker, add one near-miss that exposes using conjunction formatting for choices and changing the meaning from any option to all items. 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 conjunction formatting for choices and changing the meaning from any option to all items.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State whether the list means together or alternatively before selecting the type.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Disjunction means an or-based list?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using conjunction formatting for choices and changing the meaning from any option to all items be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework dashboard with three subjects that have tasks due today. Include one ordinary case, one boundary and one deliberate failure caused by using conjunction formatting for choices and changing the meaning from any option to all items. 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 disjunction selects patterns for alternatives, choices or acceptable substitutes. It shows a trace, not only a final value. The ordinary case should demonstrate “The output communicates alternatives with locale-sensitive or-style wording.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State whether the list means together or alternatively before selecting the type. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Disjunction means an or-based list, separate the documented JavaScript Intl.ListFormat 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 unit selects locale list patterns for sequences of unit-bearing phrases and may omit a conjunction that normal prose would use. 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 passing bare numbers and expecting ListFormat to know their units or perform measurement conversion. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Format each measurement phrase separately, then give the resulting strings to a unit ListFormat.
For the Unit is a spacing and grouping pattern chapter on JavaScript Intl.ListFormat, 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 passing bare numbers and expecting ListFormat to know their units or perform measurement conversion. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
new Intl.ListFormat('en-SG',{type:'unit'}).format(['5 km','12 min','2 stops'])Explained result. ListFormat combines the prepared unit phrases; it neither calculates nor localizes the internal numbers by itself. 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 dashboard. Transfer the rule using three subjects that have tasks due today. 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 unit selects locale list patterns for sequences of unit-bearing phrases and may omit a conjunction that normal prose would use.” Apply this procedure: Format each measurement phrase separately, then give the resulting strings to a unit ListFormat. The expected mechanism is: ListFormat combines the prepared unit phrases; it neither calculates nor localizes the internal numbers by itself. For the homework dashboard, add one near-miss that exposes passing bare numbers and expecting ListFormat to know their units or perform measurement conversion. 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 authors chosen from a user-controlled string list. 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 unit selects locale list patterns for sequences of unit-bearing phrases and may omit a conjunction that normal prose would use.” Apply this procedure: Format each measurement phrase separately, then give the resulting strings to a unit ListFormat. The expected mechanism is: ListFormat combines the prepared unit phrases; it neither calculates nor localizes the internal numbers by itself. For the reading tracker, add one near-miss that exposes passing bare numbers and expecting ListFormat to know their units or perform measurement conversion. 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 project. Contrast the rule using materials displayed as a conjunction and alternatives as a disjunction. 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 unit selects locale list patterns for sequences of unit-bearing phrases and may omit a conjunction that normal prose would use.” Apply this procedure: Format each measurement phrase separately, then give the resulting strings to a unit ListFormat. The expected mechanism is: ListFormat combines the prepared unit phrases; it neither calculates nor localizes the internal numbers by itself. For the science project, add one near-miss that exposes passing bare numbers and expecting ListFormat to know their units or perform measurement conversion. 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 available weekdays rendered in the family interface locale. 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 unit selects locale list patterns for sequences of unit-bearing phrases and may omit a conjunction that normal prose would use.” Apply this procedure: Format each measurement phrase separately, then give the resulting strings to a unit ListFormat. The expected mechanism is: ListFormat combines the prepared unit phrases; it neither calculates nor localizes the internal numbers by itself. For the CCA registration, add one near-miss that exposes passing bare numbers and expecting ListFormat to know their units or perform measurement conversion. 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 passing bare numbers and expecting ListFormat to know their units or perform measurement conversion.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Format each measurement phrase separately, then give the resulting strings to a unit ListFormat.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Unit is a spacing and grouping pattern?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing passing bare numbers and expecting ListFormat to know their units or perform measurement conversion 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 authors chosen from a user-controlled string list. Include one ordinary case, one boundary and one deliberate failure caused by passing bare numbers and expecting ListFormat to know their units or perform measurement conversion. 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 unit selects locale list patterns for sequences of unit-bearing phrases and may omit a conjunction that normal prose would use. It shows a trace, not only a final value. The ordinary case should demonstrate “ListFormat combines the prepared unit phrases; it neither calculates nor localizes the internal numbers by itself.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Format each measurement phrase separately, then give the resulting strings to a unit ListFormat. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Unit is a spacing and grouping pattern, separate the documented JavaScript Intl.ListFormat 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
style long, short or narrow selects a pattern family within the resolved type; long is the 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 assuming narrow is merely long output with fewer spaces and therefore always safe in sentences. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Render representative lists under all three styles and evaluate meaning, space and accessibility in the actual component.
For the Style changes pattern width chapter on JavaScript Intl.ListFormat, 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 narrow is merely long output with fewer spaces and therefore always safe in sentences. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
for(const style of ['long','short','narrow'])
console.log(new Intl.ListFormat('en-SG',{style}).format(['A','B','C']));Explained result. Each formatter consults a different locale style template; exact visible differences depend on locale data. 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 project. Predict the rule using materials displayed as a conjunction and alternatives as a disjunction. 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 “style long, short or narrow selects a pattern family within the resolved type; long is the default.” Apply this procedure: Render representative lists under all three styles and evaluate meaning, space and accessibility in the actual component. The expected mechanism is: Each formatter consults a different locale style template; exact visible differences depend on locale data. For the science project, add one near-miss that exposes assuming narrow is merely long output with fewer spaces and therefore always safe in sentences. 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 available weekdays rendered in the family interface locale. 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 “style long, short or narrow selects a pattern family within the resolved type; long is the default.” Apply this procedure: Render representative lists under all three styles and evaluate meaning, space and accessibility in the actual component. The expected mechanism is: Each formatter consults a different locale style template; exact visible differences depend on locale data. For the CCA registration, add one near-miss that exposes assuming narrow is merely long output with fewer spaces and therefore always safe in sentences. 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 participants whose names must keep their original order. 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 “style long, short or narrow selects a pattern family within the resolved type; long is the default.” Apply this procedure: Render representative lists under all three styles and evaluate meaning, space and accessibility in the actual component. The expected mechanism is: Each formatter consults a different locale style template; exact visible differences depend on locale data. For the family planner, add one near-miss that exposes assuming narrow is merely long output with fewer spaces and therefore always safe in sentences. 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 genres shown as compact metadata without inventing punctuation. 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 “style long, short or narrow selects a pattern family within the resolved type; long is the default.” Apply this procedure: Render representative lists under all three styles and evaluate meaning, space and accessibility in the actual component. The expected mechanism is: Each formatter consults a different locale style template; exact visible differences depend on locale data. For the library catalogue, add one near-miss that exposes assuming narrow is merely long output with fewer spaces and therefore always safe in sentences. 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 narrow is merely long output with fewer spaces and therefore always safe in sentences.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Render representative lists under all three styles and evaluate meaning, space and accessibility in the actual component.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Style changes pattern width?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing assuming narrow is merely long output with fewer spaces and therefore always safe in sentences be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny science project with materials displayed as a conjunction and alternatives as a disjunction. Include one ordinary case, one boundary and one deliberate failure caused by assuming narrow is merely long output with fewer spaces and therefore always safe in sentences. 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: style long, short or narrow selects a pattern family within the resolved type; long is the default. It shows a trace, not only a final value. The ordinary case should demonstrate “Each formatter consults a different locale style template; exact visible differences depend on locale data.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Render representative lists under all three styles and evaluate meaning, space and accessibility in the actual component. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Style changes pattern width, separate the documented JavaScript Intl.ListFormat 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
An empty iterable contains no element parts, so format returns the empty string. 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 treating the empty result as a completed user message such as Nobody selected. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Handle domain-specific empty-state wording before calling the formatter.
For the Empty input produces an empty string chapter on JavaScript Intl.ListFormat, 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 treating the empty result as a completed user message such as Nobody selected. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const lf=new Intl.ListFormat('en-SG');
console.log(JSON.stringify(lf.format([])));Explained result. The printed representation is the empty string, leaving the application responsible for an explanatory empty state. 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 participants whose names must keep their original order. 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 “An empty iterable contains no element parts, so format returns the empty string.” Apply this procedure: Handle domain-specific empty-state wording before calling the formatter. The expected mechanism is: The printed representation is the empty string, leaving the application responsible for an explanatory empty state. For the family planner, add one near-miss that exposes treating the empty result as a completed user message such as Nobody selected. 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 genres shown as compact metadata without inventing punctuation. 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 “An empty iterable contains no element parts, so format returns the empty string.” Apply this procedure: Handle domain-specific empty-state wording before calling the formatter. The expected mechanism is: The printed representation is the empty string, leaving the application responsible for an explanatory empty state. For the library catalogue, add one near-miss that exposes treating the empty result as a completed user message such as Nobody selected. 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 zero, one, two and many elements across locales, types and styles. 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 “An empty iterable contains no element parts, so format returns the empty string.” Apply this procedure: Handle domain-specific empty-state wording before calling the formatter. The expected mechanism is: The printed representation is the empty string, leaving the application responsible for an explanatory empty state. For the test laboratory, add one near-miss that exposes treating the empty result as a completed user message such as Nobody selected. 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. 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 “An empty iterable contains no element parts, so format returns the empty string.” Apply this procedure: Handle domain-specific empty-state wording before calling the formatter. The expected mechanism is: The printed representation is the empty string, leaving the application responsible for an explanatory empty state. For the design decision, add one near-miss that exposes treating the empty result as a completed user message such as Nobody selected. 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 treating the empty result as a completed user message such as Nobody selected.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Handle domain-specific empty-state wording before calling the formatter.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Empty input produces an empty string?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing treating the empty result as a completed user message such as Nobody selected 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 available weekdays rendered in the family interface locale. Include one ordinary case, one boundary and one deliberate failure caused by treating the empty result as a completed user message such as Nobody selected. 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: An empty iterable contains no element parts, so format returns the empty string. It shows a trace, not only a final value. The ordinary case should demonstrate “The printed representation is the empty string, leaving the application responsible for an explanatory empty state.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Handle domain-specific empty-state wording before calling the formatter. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Empty input produces an empty string, separate the documented JavaScript Intl.ListFormat 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
A single string needs no separator or connective and is returned as the only element 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 adding a trailing comma or conjunction through manual post-processing. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Test the one-item boundary before styling punctuation or adding surrounding prose.
For the One item stays one item chapter on JavaScript Intl.ListFormat, 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 a trailing comma or conjunction through manual post-processing. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
new Intl.ListFormat('en-SG').format(['Mathematics'])Explained result. The result is Mathematics without list punctuation because there is no second element to connect. 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 zero, one, two and many elements across locales, types and styles. 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 “A single string needs no separator or connective and is returned as the only element value.” Apply this procedure: Test the one-item boundary before styling punctuation or adding surrounding prose. The expected mechanism is: The result is Mathematics without list punctuation because there is no second element to connect. For the test laboratory, add one near-miss that exposes adding a trailing comma or conjunction through manual post-processing. 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. 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 “A single string needs no separator or connective and is returned as the only element value.” Apply this procedure: Test the one-item boundary before styling punctuation or adding surrounding prose. The expected mechanism is: The result is Mathematics without list punctuation because there is no second element to connect. For the design decision, add one near-miss that exposes adding a trailing comma or conjunction through manual post-processing. 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 dashboard. Transfer the rule using three subjects that have tasks due today. 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 “A single string needs no separator or connective and is returned as the only element value.” Apply this procedure: Test the one-item boundary before styling punctuation or adding surrounding prose. The expected mechanism is: The result is Mathematics without list punctuation because there is no second element to connect. For the homework dashboard, add one near-miss that exposes adding a trailing comma or conjunction through manual post-processing. 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 authors chosen from a user-controlled string list. 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 “A single string needs no separator or connective and is returned as the only element value.” Apply this procedure: Test the one-item boundary before styling punctuation or adding surrounding prose. The expected mechanism is: The result is Mathematics without list punctuation because there is no second element to connect. For the reading tracker, add one near-miss that exposes adding a trailing comma or conjunction through manual post-processing. 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 a trailing comma or conjunction through manual post-processing.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Test the one-item boundary before styling punctuation or adding surrounding prose.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from One item stays one item?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing adding a trailing comma or conjunction through manual post-processing 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 participants whose names must keep their original order. Include one ordinary case, one boundary and one deliberate failure caused by adding a trailing comma or conjunction through manual post-processing. 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: A single string needs no separator or connective and is returned as the only element value. It shows a trace, not only a final value. The ordinary case should demonstrate “The result is Mathematics without list punctuation because there is no second element to connect.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Test the one-item boundary before styling punctuation or adding surrounding prose. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For One item stays one item, separate the documented JavaScript Intl.ListFormat 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
A two-element list uses the locale pair pattern rather than the start and end templates used for longer lists. 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 predicting a comma from the three-item result and hard-coding that punctuation into tests. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Keep separate fixtures for zero, one, two, three and many elements.
For the Two items use the pair template chapter on JavaScript Intl.ListFormat, 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 predicting a comma from the three-item result and hard-coding that punctuation into tests. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
new Intl.ListFormat('en-SG',{type:'conjunction'}).format(['A','B'])Explained result. The pair is formatted with the locale pair template, so it need not resemble a truncated three-item pattern. 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 dashboard. Explain the rule using three subjects that have tasks due today. 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 “A two-element list uses the locale pair pattern rather than the start and end templates used for longer lists.” Apply this procedure: Keep separate fixtures for zero, one, two, three and many elements. The expected mechanism is: The pair is formatted with the locale pair template, so it need not resemble a truncated three-item pattern. For the homework dashboard, add one near-miss that exposes predicting a comma from the three-item result and hard-coding that punctuation into tests. 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 authors chosen from a user-controlled string list. 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 “A two-element list uses the locale pair pattern rather than the start and end templates used for longer lists.” Apply this procedure: Keep separate fixtures for zero, one, two, three and many elements. The expected mechanism is: The pair is formatted with the locale pair template, so it need not resemble a truncated three-item pattern. For the reading tracker, add one near-miss that exposes predicting a comma from the three-item result and hard-coding that punctuation into tests. 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 project. Predict the rule using materials displayed as a conjunction and alternatives as a disjunction. 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 “A two-element list uses the locale pair pattern rather than the start and end templates used for longer lists.” Apply this procedure: Keep separate fixtures for zero, one, two, three and many elements. The expected mechanism is: The pair is formatted with the locale pair template, so it need not resemble a truncated three-item pattern. For the science project, add one near-miss that exposes predicting a comma from the three-item result and hard-coding that punctuation into tests. 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 available weekdays rendered in the family interface locale. 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 “A two-element list uses the locale pair pattern rather than the start and end templates used for longer lists.” Apply this procedure: Keep separate fixtures for zero, one, two, three and many elements. The expected mechanism is: The pair is formatted with the locale pair template, so it need not resemble a truncated three-item pattern. For the CCA registration, add one near-miss that exposes predicting a comma from the three-item result and hard-coding that punctuation into tests. 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 predicting a comma from the three-item result and hard-coding that punctuation into tests.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Keep separate fixtures for zero, one, two, three and many elements.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Two items use the pair template?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing predicting a comma from the three-item result and hard-coding that punctuation into tests 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 genres shown as compact metadata without inventing punctuation. Include one ordinary case, one boundary and one deliberate failure caused by predicting a comma from the three-item result and hard-coding that punctuation into tests. 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: A two-element list uses the locale pair pattern rather than the start and end templates used for longer lists. It shows a trace, not only a final value. The ordinary case should demonstrate “The pair is formatted with the locale pair template, so it need not resemble a truncated three-item pattern.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Keep separate fixtures for zero, one, two, three and many elements. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Two items use the pair template, separate the documented JavaScript Intl.ListFormat 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 10 OF 20 . Handle boundaries
10. Longer lists use start, middle and end templates
For three or more strings, locale data composes the list through structural templates rather than a language-neutral comma algorithm. 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 three items and assuming a ten-item list is produced by the same single replacement. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Test several lengths and treat punctuation as output data, not an invariant to reconstruct.
For the Longer lists use start, middle and end templates chapter on JavaScript Intl.ListFormat, 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 three items and assuming a ten-item list is produced by the same single replacement. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
new Intl.ListFormat('en-SG').format(['A','B','C','D'])Explained result. The formatter builds a single localized string while retaining A, B, C and D in their original sequence. 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 project. Transfer the rule using materials displayed as a conjunction and alternatives as a disjunction. 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 “For three or more strings, locale data composes the list through structural templates rather than a language-neutral comma algorithm.” Apply this procedure: Test several lengths and treat punctuation as output data, not an invariant to reconstruct. The expected mechanism is: The formatter builds a single localized string while retaining A, B, C and D in their original sequence. For the science project, add one near-miss that exposes testing only three items and assuming a ten-item list is produced by the same single replacement. 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 available weekdays rendered in the family interface locale. 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 “For three or more strings, locale data composes the list through structural templates rather than a language-neutral comma algorithm.” Apply this procedure: Test several lengths and treat punctuation as output data, not an invariant to reconstruct. The expected mechanism is: The formatter builds a single localized string while retaining A, B, C and D in their original sequence. For the CCA registration, add one near-miss that exposes testing only three items and assuming a ten-item list is produced by the same single replacement. 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 participants whose names must keep their original order. 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 “For three or more strings, locale data composes the list through structural templates rather than a language-neutral comma algorithm.” Apply this procedure: Test several lengths and treat punctuation as output data, not an invariant to reconstruct. The expected mechanism is: The formatter builds a single localized string while retaining A, B, C and D in their original sequence. For the family planner, add one near-miss that exposes testing only three items and assuming a ten-item list is produced by the same single replacement. 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 genres shown as compact metadata without inventing punctuation. 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 “For three or more strings, locale data composes the list through structural templates rather than a language-neutral comma algorithm.” Apply this procedure: Test several lengths and treat punctuation as output data, not an invariant to reconstruct. The expected mechanism is: The formatter builds a single localized string while retaining A, B, C and D in their original sequence. For the library catalogue, add one near-miss that exposes testing only three items and assuming a ten-item list is produced by the same single replacement. 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 three items and assuming a ten-item list is produced by the same single replacement.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Test several lengths and treat punctuation as output data, not an invariant to reconstruct.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Longer lists use start, middle and end templates?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing testing only three items and assuming a ten-item list is produced by the same single replacement 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 zero, one, two and many elements across locales, types and styles. Include one ordinary case, one boundary and one deliberate failure caused by testing only three items and assuming a ten-item list is produced by the same single replacement. 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: For three or more strings, locale data composes the list through structural templates rather than a language-neutral comma algorithm. It shows a trace, not only a final value. The ordinary case should demonstrate “The formatter builds a single localized string while retaining A, B, C and D in their original sequence.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Test several lengths and treat punctuation as output data, not an invariant to reconstruct. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Longer lists use start, middle and end templates, separate the documented JavaScript Intl.ListFormat 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
format obtains strings from the supplied iterable and rejects a non-string element rather than applying arbitrary object-to-string conversion as a domain policy. 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 passing numbers, nulls or records and expecting useful labels. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Map records to intentional user-facing strings and assert every element type before formatting.
For the Input is an iterable of strings chapter on JavaScript Intl.ListFormat, 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 passing numbers, nulls or records and expecting useful labels. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const lf=new Intl.ListFormat('en-SG');
lf.format(new Set(['A','B','C']));Explained result. A Set is iterable and its string elements are accepted in iteration order; a Set of numbers would not satisfy the string-list contract. 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 participants whose names must keep their original order. 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 “format obtains strings from the supplied iterable and rejects a non-string element rather than applying arbitrary object-to-string conversion as a domain policy.” Apply this procedure: Map records to intentional user-facing strings and assert every element type before formatting. The expected mechanism is: A Set is iterable and its string elements are accepted in iteration order; a Set of numbers would not satisfy the string-list contract. For the family planner, add one near-miss that exposes passing numbers, nulls or records and expecting useful 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. Contrast the rule using genres shown as compact metadata without inventing punctuation. 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 “format obtains strings from the supplied iterable and rejects a non-string element rather than applying arbitrary object-to-string conversion as a domain policy.” Apply this procedure: Map records to intentional user-facing strings and assert every element type before formatting. The expected mechanism is: A Set is iterable and its string elements are accepted in iteration order; a Set of numbers would not satisfy the string-list contract. For the library catalogue, add one near-miss that exposes passing numbers, nulls or records and expecting useful 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. Stress-test the rule using zero, one, two and many elements across locales, types and styles. 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 “format obtains strings from the supplied iterable and rejects a non-string element rather than applying arbitrary object-to-string conversion as a domain policy.” Apply this procedure: Map records to intentional user-facing strings and assert every element type before formatting. The expected mechanism is: A Set is iterable and its string elements are accepted in iteration order; a Set of numbers would not satisfy the string-list contract. For the test laboratory, add one near-miss that exposes passing numbers, nulls or records and expecting useful 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. Explain the rule using ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. 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 “format obtains strings from the supplied iterable and rejects a non-string element rather than applying arbitrary object-to-string conversion as a domain policy.” Apply this procedure: Map records to intentional user-facing strings and assert every element type before formatting. The expected mechanism is: A Set is iterable and its string elements are accepted in iteration order; a Set of numbers would not satisfy the string-list contract. For the design decision, add one near-miss that exposes passing numbers, nulls or records and expecting useful 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 passing numbers, nulls or records and expecting useful labels.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Map records to intentional user-facing strings and assert every element type before formatting.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Input is an iterable of strings?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing passing numbers, nulls or records and expecting useful 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. Include one ordinary case, one boundary and one deliberate failure caused by passing numbers, nulls or records and expecting useful 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: format obtains strings from the supplied iterable and rejects a non-string element rather than applying arbitrary object-to-string conversion as a domain policy. It shows a trace, not only a final value. The ordinary case should demonstrate “A Set is iterable and its string elements are accepted in iteration order; a Set of numbers would not satisfy the string-list contract.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Map records to intentional user-facing strings and assert every element type before formatting. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Input is an iterable of strings, separate the documented JavaScript Intl.ListFormat 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
A generator can supply the list, but iteration consumes it; reusing the same exhausted generator does not reproduce the original elements. 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 one generator twice and blaming ListFormat when the second result is empty. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Materialize reusable data as an array or create a fresh generator for each consumption.
For the Generators are consumed as iterables chapter on JavaScript Intl.ListFormat, 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 one generator twice and blaming ListFormat when the second result is empty. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
function* names(){yield 'A';yield 'B'}
const g=names(),lf=new Intl.ListFormat('en-SG');
console.log(lf.format(g),lf.format(g));Explained result. The first call consumes A and B; the second sees the exhausted iterator and formats an empty list. 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 zero, one, two and many elements across locales, types and styles. 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 “A generator can supply the list, but iteration consumes it; reusing the same exhausted generator does not reproduce the original elements.” Apply this procedure: Materialize reusable data as an array or create a fresh generator for each consumption. The expected mechanism is: The first call consumes A and B; the second sees the exhausted iterator and formats an empty list. For the test laboratory, add one near-miss that exposes formatting one generator twice and blaming ListFormat when the second result is empty. 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. 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 “A generator can supply the list, but iteration consumes it; reusing the same exhausted generator does not reproduce the original elements.” Apply this procedure: Materialize reusable data as an array or create a fresh generator for each consumption. The expected mechanism is: The first call consumes A and B; the second sees the exhausted iterator and formats an empty list. For the design decision, add one near-miss that exposes formatting one generator twice and blaming ListFormat when the second result is empty. 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 dashboard. Explain the rule using three subjects that have tasks due today. 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 “A generator can supply the list, but iteration consumes it; reusing the same exhausted generator does not reproduce the original elements.” Apply this procedure: Materialize reusable data as an array or create a fresh generator for each consumption. The expected mechanism is: The first call consumes A and B; the second sees the exhausted iterator and formats an empty list. For the homework dashboard, add one near-miss that exposes formatting one generator twice and blaming ListFormat when the second result is empty. 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 authors chosen from a user-controlled string list. 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 “A generator can supply the list, but iteration consumes it; reusing the same exhausted generator does not reproduce the original elements.” Apply this procedure: Materialize reusable data as an array or create a fresh generator for each consumption. The expected mechanism is: The first call consumes A and B; the second sees the exhausted iterator and formats an empty list. For the reading tracker, add one near-miss that exposes formatting one generator twice and blaming ListFormat when the second result is empty. 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 one generator twice and blaming ListFormat when the second result is empty.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Materialize reusable data as an array or create a fresh generator for each consumption.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Generators are consumed as iterables?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing formatting one generator twice and blaming ListFormat when the second result is empty be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework dashboard with three subjects that have tasks due today. Include one ordinary case, one boundary and one deliberate failure caused by formatting one generator twice and blaming ListFormat when the second result is empty. 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: A generator can supply the list, but iteration consumes it; reusing the same exhausted generator does not reproduce the original elements. It shows a trace, not only a final value. The ordinary case should demonstrate “The first call consumes A and B; the second sees the exhausted iterator and formats an empty list.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Materialize reusable data as an array or create a fresh generator for each consumption. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Generators are consumed as iterables, separate the documented JavaScript Intl.ListFormat 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() exposes the resolved locale, type and style used by the formatter. 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 inspecting the constructor arguments and assuming fallback negotiation cannot change the effective locale. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Capture resolvedOptions in compatibility tests and log it beside unexpected output.
For the resolvedOptions reports the effective setup chapter on JavaScript Intl.ListFormat, 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 inspecting the constructor arguments and assuming fallback negotiation cannot change the effective locale. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const lf=new Intl.ListFormat('en-SG',{type:'disjunction',style:'short'});
console.log(lf.resolvedOptions());Explained result. The returned ordinary object reports the effective locale, disjunction type and short style. 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 dashboard. Stress-test the rule using three subjects that have tasks due today. 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() exposes the resolved locale, type and style used by the formatter.” Apply this procedure: Capture resolvedOptions in compatibility tests and log it beside unexpected output. The expected mechanism is: The returned ordinary object reports the effective locale, disjunction type and short style. For the homework dashboard, add one near-miss that exposes inspecting the constructor arguments and assuming fallback negotiation cannot change the effective 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: reading tracker. Explain the rule using authors chosen from a user-controlled string list. 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() exposes the resolved locale, type and style used by the formatter.” Apply this procedure: Capture resolvedOptions in compatibility tests and log it beside unexpected output. The expected mechanism is: The returned ordinary object reports the effective locale, disjunction type and short style. For the reading tracker, add one near-miss that exposes inspecting the constructor arguments and assuming fallback negotiation cannot change the effective 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: science project. Transfer the rule using materials displayed as a conjunction and alternatives as a disjunction. 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() exposes the resolved locale, type and style used by the formatter.” Apply this procedure: Capture resolvedOptions in compatibility tests and log it beside unexpected output. The expected mechanism is: The returned ordinary object reports the effective locale, disjunction type and short style. For the science project, add one near-miss that exposes inspecting the constructor arguments and assuming fallback negotiation cannot change the effective 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: CCA registration. Predict the rule using available weekdays rendered in the family interface locale. 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() exposes the resolved locale, type and style used by the formatter.” Apply this procedure: Capture resolvedOptions in compatibility tests and log it beside unexpected output. The expected mechanism is: The returned ordinary object reports the effective locale, disjunction type and short style. For the CCA registration, add one near-miss that exposes inspecting the constructor arguments and assuming fallback negotiation cannot change the effective 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 inspecting the constructor arguments and assuming fallback negotiation cannot change the effective locale.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Capture resolvedOptions in compatibility tests and log it beside unexpected output.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from resolvedOptions reports the effective setup?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing inspecting the constructor arguments and assuming fallback negotiation cannot change the effective locale 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 authors chosen from a user-controlled string list. Include one ordinary case, one boundary and one deliberate failure caused by inspecting the constructor arguments and assuming fallback negotiation cannot change the effective 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: resolvedOptions() exposes the resolved locale, type and style used by the formatter. It shows a trace, not only a final value. The ordinary case should demonstrate “The returned ordinary object reports the effective locale, disjunction type and short style.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Capture resolvedOptions in compatibility tests and log it beside unexpected output. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For resolvedOptions reports the effective setup, separate the documented JavaScript Intl.ListFormat 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
Intl.ListFormat.supportedLocalesOf() filters requested locale identifiers to those supportable without falling back to an unrelated 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 using one formatted sample to infer support for every requested locale. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Check support during setup and define an application fallback policy for unsupported requests.
For the supportedLocalesOf tests locale support chapter on JavaScript Intl.ListFormat, 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 one formatted sample to infer support for every requested locale. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
Intl.ListFormat.supportedLocalesOf(['en-SG','ms-SG','zz-ZZ'])Explained result. Supported well-formed locales are returned according to the chosen matching options; an unsupported private example is not evidence of translated content. 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 project. Explain the rule using materials displayed as a conjunction and alternatives as a disjunction. 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.ListFormat.supportedLocalesOf() filters requested locale identifiers to those supportable without falling back to an unrelated default.” Apply this procedure: Check support during setup and define an application fallback policy for unsupported requests. The expected mechanism is: Supported well-formed locales are returned according to the chosen matching options; an unsupported private example is not evidence of translated content. For the science project, add one near-miss that exposes using one formatted sample to infer support for every requested 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 available weekdays rendered in the family interface locale. 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.ListFormat.supportedLocalesOf() filters requested locale identifiers to those supportable without falling back to an unrelated default.” Apply this procedure: Check support during setup and define an application fallback policy for unsupported requests. The expected mechanism is: Supported well-formed locales are returned according to the chosen matching options; an unsupported private example is not evidence of translated content. For the CCA registration, add one near-miss that exposes using one formatted sample to infer support for every requested 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 participants whose names must keep their original order. 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.ListFormat.supportedLocalesOf() filters requested locale identifiers to those supportable without falling back to an unrelated default.” Apply this procedure: Check support during setup and define an application fallback policy for unsupported requests. The expected mechanism is: Supported well-formed locales are returned according to the chosen matching options; an unsupported private example is not evidence of translated content. For the family planner, add one near-miss that exposes using one formatted sample to infer support for every requested 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 genres shown as compact metadata without inventing punctuation. 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.ListFormat.supportedLocalesOf() filters requested locale identifiers to those supportable without falling back to an unrelated default.” Apply this procedure: Check support during setup and define an application fallback policy for unsupported requests. The expected mechanism is: Supported well-formed locales are returned according to the chosen matching options; an unsupported private example is not evidence of translated content. For the library catalogue, add one near-miss that exposes using one formatted sample to infer support for every requested 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 using one formatted sample to infer support for every requested locale.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Check support during setup and define an application fallback policy for unsupported requests.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from supportedLocalesOf tests locale support?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using one formatted sample to infer support for every requested locale be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny science project with materials displayed as a conjunction and alternatives as a disjunction. Include one ordinary case, one boundary and one deliberate failure caused by using one formatted sample to infer support for every requested 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: Intl.ListFormat.supportedLocalesOf() filters requested locale identifiers to those supportable without falling back to an unrelated default. It shows a trace, not only a final value. The ordinary case should demonstrate “Supported well-formed locales are returned according to the chosen matching options; an unsupported private example is not evidence of translated content.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Check support during setup and define an application fallback policy for unsupported requests. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For supportedLocalesOf tests locale support, separate the documented JavaScript Intl.ListFormat 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
formatToParts() returns element and literal records, allowing structured rendering without parsing commas, spaces or connective words. 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 splitting the formatted string on commas and breaking locales with different punctuation or conjunction placement. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Render element parts as content and literal parts as formatter-owned text while preserving order.
For the formatToParts preserves structure chapter on JavaScript Intl.ListFormat, 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 splitting the formatted string on commas and breaking locales with different punctuation or conjunction placement. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
new Intl.ListFormat('en-SG').formatToParts(['A','B','C'])Explained result. The array alternates element values with locale-owned literal fragments so the application can style elements without reverse-engineering grammar. 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 participants whose names must keep their original order. 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 “formatToParts() returns element and literal records, allowing structured rendering without parsing commas, spaces or connective words.” Apply this procedure: Render element parts as content and literal parts as formatter-owned text while preserving order. The expected mechanism is: The array alternates element values with locale-owned literal fragments so the application can style elements without reverse-engineering grammar. For the family planner, add one near-miss that exposes splitting the formatted string on commas and breaking locales with different punctuation or conjunction placement. 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 genres shown as compact metadata without inventing punctuation. 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 “formatToParts() returns element and literal records, allowing structured rendering without parsing commas, spaces or connective words.” Apply this procedure: Render element parts as content and literal parts as formatter-owned text while preserving order. The expected mechanism is: The array alternates element values with locale-owned literal fragments so the application can style elements without reverse-engineering grammar. For the library catalogue, add one near-miss that exposes splitting the formatted string on commas and breaking locales with different punctuation or conjunction placement. 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 zero, one, two and many elements across locales, types and styles. 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 “formatToParts() returns element and literal records, allowing structured rendering without parsing commas, spaces or connective words.” Apply this procedure: Render element parts as content and literal parts as formatter-owned text while preserving order. The expected mechanism is: The array alternates element values with locale-owned literal fragments so the application can style elements without reverse-engineering grammar. For the test laboratory, add one near-miss that exposes splitting the formatted string on commas and breaking locales with different punctuation or conjunction placement. 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. 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 “formatToParts() returns element and literal records, allowing structured rendering without parsing commas, spaces or connective words.” Apply this procedure: Render element parts as content and literal parts as formatter-owned text while preserving order. The expected mechanism is: The array alternates element values with locale-owned literal fragments so the application can style elements without reverse-engineering grammar. For the design decision, add one near-miss that exposes splitting the formatted string on commas and breaking locales with different punctuation or conjunction placement. 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 splitting the formatted string on commas and breaking locales with different punctuation or conjunction placement.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Render element parts as content and literal parts as formatter-owned text while preserving order.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from formatToParts preserves structure?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing splitting the formatted string on commas and breaking locales with different punctuation or conjunction placement 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 available weekdays rendered in the family interface locale. Include one ordinary case, one boundary and one deliberate failure caused by splitting the formatted string on commas and breaking locales with different punctuation or conjunction placement. 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: formatToParts() returns element and literal records, allowing structured rendering without parsing commas, spaces or connective words. It shows a trace, not only a final value. The ordinary case should demonstrate “The array alternates element values with locale-owned literal fragments so the application can style elements without reverse-engineering grammar.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Render element parts as content and literal parts as formatter-owned text while preserving order. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For formatToParts preserves structure, separate the documented JavaScript Intl.ListFormat 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 16 OF 20 . Debug and verify
16. Parts are for rendering, not rewriting grammar
Literal parts contain meaningful spaces, punctuation and connective text that should normally remain intact. 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 trimming every literal or replacing the final literal with an English ampersand. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Preserve literal values exactly and customize only element wrappers unless a qualified localization design specifies otherwise.
For the Parts are for rendering, not rewriting grammar chapter on JavaScript Intl.ListFormat, 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 trimming every literal or replacing the final literal with an English ampersand. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const parts=new Intl.ListFormat('en-SG').formatToParts(['A','B']);
const html=parts.map(p=>p.type==='element'?'<b>'+p.value+'</b>':p.value).join('');Explained result. Element values gain markup while the locale literal remains the authoritative connection between 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: test laboratory. Predict the rule using zero, one, two and many elements across locales, types and styles. 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 “Literal parts contain meaningful spaces, punctuation and connective text that should normally remain intact.” Apply this procedure: Preserve literal values exactly and customize only element wrappers unless a qualified localization design specifies otherwise. The expected mechanism is: Element values gain markup while the locale literal remains the authoritative connection between them. For the test laboratory, add one near-miss that exposes trimming every literal or replacing the final literal with an English ampersand. 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. 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 “Literal parts contain meaningful spaces, punctuation and connective text that should normally remain intact.” Apply this procedure: Preserve literal values exactly and customize only element wrappers unless a qualified localization design specifies otherwise. The expected mechanism is: Element values gain markup while the locale literal remains the authoritative connection between them. For the design decision, add one near-miss that exposes trimming every literal or replacing the final literal with an English ampersand. 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 dashboard. Stress-test the rule using three subjects that have tasks due today. 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 “Literal parts contain meaningful spaces, punctuation and connective text that should normally remain intact.” Apply this procedure: Preserve literal values exactly and customize only element wrappers unless a qualified localization design specifies otherwise. The expected mechanism is: Element values gain markup while the locale literal remains the authoritative connection between them. For the homework dashboard, add one near-miss that exposes trimming every literal or replacing the final literal with an English ampersand. 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 authors chosen from a user-controlled string list. 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 “Literal parts contain meaningful spaces, punctuation and connective text that should normally remain intact.” Apply this procedure: Preserve literal values exactly and customize only element wrappers unless a qualified localization design specifies otherwise. The expected mechanism is: Element values gain markup while the locale literal remains the authoritative connection between them. For the reading tracker, add one near-miss that exposes trimming every literal or replacing the final literal with an English ampersand. 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 trimming every literal or replacing the final literal with an English ampersand.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Preserve literal values exactly and customize only element wrappers unless a qualified localization design specifies otherwise.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Parts are for rendering, not rewriting grammar?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing trimming every literal or replacing the final literal with an English ampersand 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 participants whose names must keep their original order. Include one ordinary case, one boundary and one deliberate failure caused by trimming every literal or replacing the final literal with an English ampersand. 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: Literal parts contain meaningful spaces, punctuation and connective text that should normally remain intact. It shows a trace, not only a final value. The ordinary case should demonstrate “Element values gain markup while the locale literal remains the authoritative connection between them.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Preserve literal values exactly and customize only element wrappers unless a qualified localization design specifies otherwise. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Parts are for rendering, not rewriting grammar, separate the documented JavaScript Intl.ListFormat 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 17 OF 20 . Transfer with judgment
17. Locale output is not an Oxford-comma promise
Comma choice is part of locale data and list length, type and style; Intl.ListFormat does not promise one house-style punctuation rule across languages. 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 asserting one exact English punctuation string as the universal semantic test. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Test exact snapshots only for supported locale-data expectations and test element order and parts for broader invariants.
For the Locale output is not an Oxford-comma promise chapter on JavaScript Intl.ListFormat, 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 asserting one exact English punctuation string as the universal semantic test. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
new Intl.ListFormat('en-GB').format(['A','B','C'])Explained result. The exact punctuation belongs to the resolved locale data, so product copy rules should not be inferred from a different locale. 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 dashboard. Contrast the rule using three subjects that have tasks due today. 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 “Comma choice is part of locale data and list length, type and style; Intl.ListFormat does not promise one house-style punctuation rule across languages.” Apply this procedure: Test exact snapshots only for supported locale-data expectations and test element order and parts for broader invariants. The expected mechanism is: The exact punctuation belongs to the resolved locale data, so product copy rules should not be inferred from a different locale. For the homework dashboard, add one near-miss that exposes asserting one exact English punctuation string as the universal semantic 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: reading tracker. Stress-test the rule using authors chosen from a user-controlled string list. 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 “Comma choice is part of locale data and list length, type and style; Intl.ListFormat does not promise one house-style punctuation rule across languages.” Apply this procedure: Test exact snapshots only for supported locale-data expectations and test element order and parts for broader invariants. The expected mechanism is: The exact punctuation belongs to the resolved locale data, so product copy rules should not be inferred from a different locale. For the reading tracker, add one near-miss that exposes asserting one exact English punctuation string as the universal semantic 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: science project. Explain the rule using materials displayed as a conjunction and alternatives as a disjunction. 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 “Comma choice is part of locale data and list length, type and style; Intl.ListFormat does not promise one house-style punctuation rule across languages.” Apply this procedure: Test exact snapshots only for supported locale-data expectations and test element order and parts for broader invariants. The expected mechanism is: The exact punctuation belongs to the resolved locale data, so product copy rules should not be inferred from a different locale. For the science project, add one near-miss that exposes asserting one exact English punctuation string as the universal semantic 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: CCA registration. Transfer the rule using available weekdays rendered in the family interface locale. 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 “Comma choice is part of locale data and list length, type and style; Intl.ListFormat does not promise one house-style punctuation rule across languages.” Apply this procedure: Test exact snapshots only for supported locale-data expectations and test element order and parts for broader invariants. The expected mechanism is: The exact punctuation belongs to the resolved locale data, so product copy rules should not be inferred from a different locale. For the CCA registration, add one near-miss that exposes asserting one exact English punctuation string as the universal semantic 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 asserting one exact English punctuation string as the universal semantic test.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Test exact snapshots only for supported locale-data expectations and test element order and parts for broader invariants.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Locale output is not an Oxford-comma promise?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing asserting one exact English punctuation string as the universal semantic test 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 genres shown as compact metadata without inventing punctuation. Include one ordinary case, one boundary and one deliberate failure caused by asserting one exact English punctuation string as the universal semantic 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: Comma choice is part of locale data and list length, type and style; Intl.ListFormat does not promise one house-style punctuation rule across languages. It shows a trace, not only a final value. The ordinary case should demonstrate “The exact punctuation belongs to the resolved locale data, so product copy rules should not be inferred from a different locale.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Test exact snapshots only for supported locale-data expectations and test element order and parts for broader invariants. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Locale output is not an Oxford-comma promise, separate the documented JavaScript Intl.ListFormat 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 18 OF 20 . Transfer with judgment
18. Mixed-direction text needs structural care
Locale-aware literals help, but names and phrases may contain right-to-left and left-to-right text that still needs safe document direction handling. 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 building HTML by concatenating unescaped element strings around localized punctuation. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Create DOM text nodes or escaped output, retain parts and test representative bidirectional names with dir auto where appropriate.
For the Mixed-direction text needs structural care chapter on JavaScript Intl.ListFormat, 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 building HTML by concatenating unescaped element strings around localized punctuation. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const parts=new Intl.ListFormat('ar').formatToParts(['Alice','ليلى','陈']);Explained result. The parts preserve element boundaries for safer rendering, while the component remains responsible for markup safety and direction policy. 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 project. Stress-test the rule using materials displayed as a conjunction and alternatives as a disjunction. 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 “Locale-aware literals help, but names and phrases may contain right-to-left and left-to-right text that still needs safe document direction handling.” Apply this procedure: Create DOM text nodes or escaped output, retain parts and test representative bidirectional names with dir auto where appropriate. The expected mechanism is: The parts preserve element boundaries for safer rendering, while the component remains responsible for markup safety and direction policy. For the science project, add one near-miss that exposes building HTML by concatenating unescaped element strings around localized punctuation. 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 available weekdays rendered in the family interface locale. 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 “Locale-aware literals help, but names and phrases may contain right-to-left and left-to-right text that still needs safe document direction handling.” Apply this procedure: Create DOM text nodes or escaped output, retain parts and test representative bidirectional names with dir auto where appropriate. The expected mechanism is: The parts preserve element boundaries for safer rendering, while the component remains responsible for markup safety and direction policy. For the CCA registration, add one near-miss that exposes building HTML by concatenating unescaped element strings around localized punctuation. 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 participants whose names must keep their original order. 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 “Locale-aware literals help, but names and phrases may contain right-to-left and left-to-right text that still needs safe document direction handling.” Apply this procedure: Create DOM text nodes or escaped output, retain parts and test representative bidirectional names with dir auto where appropriate. The expected mechanism is: The parts preserve element boundaries for safer rendering, while the component remains responsible for markup safety and direction policy. For the family planner, add one near-miss that exposes building HTML by concatenating unescaped element strings around localized punctuation. 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 genres shown as compact metadata without inventing punctuation. 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 “Locale-aware literals help, but names and phrases may contain right-to-left and left-to-right text that still needs safe document direction handling.” Apply this procedure: Create DOM text nodes or escaped output, retain parts and test representative bidirectional names with dir auto where appropriate. The expected mechanism is: The parts preserve element boundaries for safer rendering, while the component remains responsible for markup safety and direction policy. For the library catalogue, add one near-miss that exposes building HTML by concatenating unescaped element strings around localized punctuation. 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 building HTML by concatenating unescaped element strings around localized punctuation.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Create DOM text nodes or escaped output, retain parts and test representative bidirectional names with dir auto where appropriate.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Mixed-direction text needs structural care?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing building HTML by concatenating unescaped element strings around localized punctuation 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 zero, one, two and many elements across locales, types and styles. Include one ordinary case, one boundary and one deliberate failure caused by building HTML by concatenating unescaped element strings around localized punctuation. 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: Locale-aware literals help, but names and phrases may contain right-to-left and left-to-right text that still needs safe document direction handling. It shows a trace, not only a final value. The ordinary case should demonstrate “The parts preserve element boundaries for safer rendering, while the component remains responsible for markup safety and direction policy.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Create DOM text nodes or escaped output, retain parts and test representative bidirectional names with dir auto where appropriate. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Mixed-direction text needs structural care, separate the documented JavaScript Intl.ListFormat 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
Constructing a formatter for every cell or render can add avoidable work; a reusable formatter is appropriate when locale, type and style are unchanged. 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 sharing one global formatter after the user changes language or semantic list type. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Key a small cache by canonical locale request, type and style, then invalidate it with locale state changes.
For the Cache formatters by resolved intent chapter on JavaScript Intl.ListFormat, 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 sharing one global formatter after the user changes language or semantic list type. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const key=JSON.stringify(['en-SG','conjunction','long']);
cache.get(key)??cache.set(key,new Intl.ListFormat('en-SG')).get(key)Explained result. Calls with the same presentation intent can reuse one formatter without mixing settings from another locale or list meaning. 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 participants whose names must keep their original order. 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 “Constructing a formatter for every cell or render can add avoidable work; a reusable formatter is appropriate when locale, type and style are unchanged.” Apply this procedure: Key a small cache by canonical locale request, type and style, then invalidate it with locale state changes. The expected mechanism is: Calls with the same presentation intent can reuse one formatter without mixing settings from another locale or list meaning. For the family planner, add one near-miss that exposes sharing one global formatter after the user changes language or semantic list type. 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 genres shown as compact metadata without inventing punctuation. 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 “Constructing a formatter for every cell or render can add avoidable work; a reusable formatter is appropriate when locale, type and style are unchanged.” Apply this procedure: Key a small cache by canonical locale request, type and style, then invalidate it with locale state changes. The expected mechanism is: Calls with the same presentation intent can reuse one formatter without mixing settings from another locale or list meaning. For the library catalogue, add one near-miss that exposes sharing one global formatter after the user changes language or semantic list type. 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 zero, one, two and many elements across locales, types and styles. 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 “Constructing a formatter for every cell or render can add avoidable work; a reusable formatter is appropriate when locale, type and style are unchanged.” Apply this procedure: Key a small cache by canonical locale request, type and style, then invalidate it with locale state changes. The expected mechanism is: Calls with the same presentation intent can reuse one formatter without mixing settings from another locale or list meaning. For the test laboratory, add one near-miss that exposes sharing one global formatter after the user changes language or semantic list type. 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. 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 “Constructing a formatter for every cell or render can add avoidable work; a reusable formatter is appropriate when locale, type and style are unchanged.” Apply this procedure: Key a small cache by canonical locale request, type and style, then invalidate it with locale state changes. The expected mechanism is: Calls with the same presentation intent can reuse one formatter without mixing settings from another locale or list meaning. For the design decision, add one near-miss that exposes sharing one global formatter after the user changes language or semantic list type. 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 sharing one global formatter after the user changes language or semantic list type.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Key a small cache by canonical locale request, type and style, then invalidate it with locale state changes.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Cache formatters by resolved intent?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing sharing one global formatter after the user changes language or semantic list type 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. Include one ordinary case, one boundary and one deliberate failure caused by sharing one global formatter after the user changes language or semantic list type. 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: Constructing a formatter for every cell or render can add avoidable work; a reusable formatter is appropriate when locale, type and style are unchanged. It shows a trace, not only a final value. The ordinary case should demonstrate “Calls with the same presentation intent can reuse one formatter without mixing settings from another locale or list meaning.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Key a small cache by canonical locale request, type and style, then invalidate it with locale state changes. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Cache formatters by resolved intent, separate the documented JavaScript Intl.ListFormat 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. Choose ListFormat after semantic preparation
Use ListFormat when ordered strings need locale-sensitive list grammar; use join for machine formats, NumberFormat for numbers, DisplayNames for names and domain code for sorting or translation. 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 treating every comma-separated output as the same problem. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Name the audience, locale, relationship, width and empty-state policy before selecting the API.
For the Choose ListFormat after semantic preparation chapter on JavaScript Intl.ListFormat, 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 treating every comma-separated output as the same problem. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
const labels=records.map(toLocalizedLabel);
const text=new Intl.ListFormat(locale,{type:'conjunction',style:'long'}).format(labels);Explained result. Domain code creates meaningful localized labels and order; ListFormat supplies the final locale-sensitive list grammar. 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 zero, one, two and many elements across locales, types and styles. 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 “Use ListFormat when ordered strings need locale-sensitive list grammar; use join for machine formats, NumberFormat for numbers, DisplayNames for names and domain code for sorting or translation.” Apply this procedure: Name the audience, locale, relationship, width and empty-state policy before selecting the API. The expected mechanism is: Domain code creates meaningful localized labels and order; ListFormat supplies the final locale-sensitive list grammar. For the test laboratory, add one near-miss that exposes treating every comma-separated output as the same problem. 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. 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 “Use ListFormat when ordered strings need locale-sensitive list grammar; use join for machine formats, NumberFormat for numbers, DisplayNames for names and domain code for sorting or translation.” Apply this procedure: Name the audience, locale, relationship, width and empty-state policy before selecting the API. The expected mechanism is: Domain code creates meaningful localized labels and order; ListFormat supplies the final locale-sensitive list grammar. For the design decision, add one near-miss that exposes treating every comma-separated output as the same problem. 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 dashboard. Contrast the rule using three subjects that have tasks due today. 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 “Use ListFormat when ordered strings need locale-sensitive list grammar; use join for machine formats, NumberFormat for numbers, DisplayNames for names and domain code for sorting or translation.” Apply this procedure: Name the audience, locale, relationship, width and empty-state policy before selecting the API. The expected mechanism is: Domain code creates meaningful localized labels and order; ListFormat supplies the final locale-sensitive list grammar. For the homework dashboard, add one near-miss that exposes treating every comma-separated output as the same problem. 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 authors chosen from a user-controlled string list. 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 “Use ListFormat when ordered strings need locale-sensitive list grammar; use join for machine formats, NumberFormat for numbers, DisplayNames for names and domain code for sorting or translation.” Apply this procedure: Name the audience, locale, relationship, width and empty-state policy before selecting the API. The expected mechanism is: Domain code creates meaningful localized labels and order; ListFormat supplies the final locale-sensitive list grammar. For the reading tracker, add one near-miss that exposes treating every comma-separated output as the same problem. 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 treating every comma-separated output as the same problem.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “Name the audience, locale, relationship, width and empty-state policy before selecting the API.” 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.ListFormat syntax. For this chapter, useful prompts are: “What did you expect from Choose ListFormat after semantic preparation?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing treating every comma-separated output as the same problem be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework dashboard with three subjects that have tasks due today. Include one ordinary case, one boundary and one deliberate failure caused by treating every comma-separated output as the same problem. 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: Use ListFormat when ordered strings need locale-sensitive list grammar; use join for machine formats, NumberFormat for numbers, DisplayNames for names and domain code for sorting or translation. It shows a trace, not only a final value. The ordinary case should demonstrate “Domain code creates meaningful localized labels and order; ListFormat supplies the final locale-sensitive list grammar.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Name the audience, locale, relationship, width and empty-state policy before selecting the API. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Choose ListFormat after semantic preparation, separate the documented JavaScript Intl.ListFormat 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 dashboard: model, boundary and recovery
Create a small homework dashboard using three subjects that have tasks due today. Combine “ListFormat is a presentation service” 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: Intl.ListFormat formats an already chosen ordered list of strings; it does not sort, translate, deduplicate or validate domain meaning. Apply: Prepare the semantic strings first, freeze their order, then call the formatter only at the presentation boundary. Verify: The returned string uses the resolved locale list pattern while preserving the supplied element order. 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 authors chosen from a user-controlled string list. Combine “Disjunction means an or-based list” 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 disjunction selects patterns for alternatives, choices or acceptable substitutes. Apply: State whether the list means together or alternatively before selecting the type. Verify: The output communicates alternatives with locale-sensitive or-style wording. 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 project: model, boundary and recovery
Create a small science project using materials displayed as a conjunction and alternatives as a disjunction. Combine “Empty input produces an empty string” 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: An empty iterable contains no element parts, so format returns the empty string. Apply: Handle domain-specific empty-state wording before calling the formatter. Verify: The printed representation is the empty string, leaving the application responsible for an explanatory empty state. 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 available weekdays rendered in the family interface locale. Combine “Longer lists use start, middle and end templates” 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: For three or more strings, locale data composes the list through structural templates rather than a language-neutral comma algorithm. Apply: Test several lengths and treat punctuation as output data, not an invariant to reconstruct. Verify: The formatter builds a single localized string while retaining A, B, C and D in their original sequence. 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 participants whose names must keep their original order. Combine “resolvedOptions reports the effective setup” 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: resolvedOptions() exposes the resolved locale, type and style used by the formatter. Apply: Capture resolvedOptions in compatibility tests and log it beside unexpected output. Verify: The returned ordinary object reports the effective locale, disjunction type and short style. 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 genres shown as compact metadata without inventing punctuation. Combine “Parts are for rendering, not rewriting grammar” 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: Literal parts contain meaningful spaces, punctuation and connective text that should normally remain intact. Apply: Preserve literal values exactly and customize only element wrappers unless a qualified localization design specifies otherwise. Verify: Element values gain markup while the locale literal remains the authoritative connection between 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.
7. test laboratory: model, boundary and recovery
Create a small test laboratory using zero, one, two and many elements across locales, types and styles. Combine “Cache formatters by resolved intent” 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: Constructing a formatter for every cell or render can add avoidable work; a reusable formatter is appropriate when locale, type and style are unchanged. Apply: Key a small cache by canonical locale request, type and style, then invalidate it with locale state changes. Verify: Calls with the same presentation intent can reuse one formatter without mixing settings from another locale or list meaning. 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 ListFormat compared with join(), PluralRules, DisplayNames and hand-written templates. Combine “Construct with new and an explicit 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: Intl.ListFormat is a service constructor and must be called with new; locale negotiation resolves from the requested locale priority list. Apply: Pass the interface locale deliberately and inspect resolvedOptions() in tests. Verify: A formatter is constructed with one supported resolved locale chosen from the request and implementation data. 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.

