Mr. Tono’s shopping goes on the receipt as one sentence: the real Intl.ListFormat builds it per language, formatToParts shows the joins, and you can try…
Why it matters
Lists are everywhere: tags, authors, categories, "sent to A, B, and 3 others". Building them yourself means a missing connecting word, a wrong Oxford comma, and a "dan" left behind when the app is translated. ListFormat writes them right for every language.
The key idea
The connecting words and the commas belong to the language, not to your code
Common mistakes
A tag list in the UI has no connecting word, only commas That is isi.join(', '): no "and/or", no idea of the language, the wrong Oxford comma. Use Intl.ListFormat for lists people read.
After the app is translated, the word "dan" still shows in the original language It means ' dan ' was written by hand between the items. The comma for three or more breaks too. ListFormat handles every rule per locale.
A page with many lists feels slow Building a new Intl.ListFormat on every render is expensive. Build one per locale and options, then reuse its .format().
Try it in this playground
Try two goods "beras dan gula": with two goods the comma goes, in every locale on the board.
Switch type to 'disjunction' "dan" becomes "atau", "and" becomes "or": one option, each language’s right word.
Pick the en-GB locale With three goods or more, en-GB writes no comma before "and"; en-US does.
Switch the list to 'number' ListFormat throws a TypeError: the items must be strings.