Course lesson
Formatting Lists of Items With the Intl Javascript API
Displaying a list is one of the most used ways to showcase information in a web app. But since your users speak different languages you need a way to format the list based on that language convention.
- Duration
- 2 min
- Access
- Free
- Transcript
- Retained from source evidence
Displaying a list is one of the most used ways to showcase information in a web app. But since your users speak different languages you need a way to format the list based on that language convention.
To avoid the hassle of implementing these formatting rules by hand - that could be really hard - Intl offers the ListFormat API.
What this formatter does is basically join an array of strings with the correct conjunction or disjunction to create a meaningful phrase.