Building Your Learning Module...
Getting things ready for you!
Find videos you like?
Save to resource drawer for future reference!
The Intl object provides language-sensitive string comparison, number formatting, and date/time formatting. Build apps that work perfectly in any language or region!
Format dates and times
Format numbers & currency
Compare & sort strings
Handle pluralization
new Intl.API(locale, options).format(value)Language/region code like "en-US" or "fr-FR"
Object with formatting preferences (style, currency, notation, etc.)
Method to format the value according to locale & options
Create the formatter once and reuse it for better performance when formatting multiple values!
Format dates and times for different locales
new Intl.DateTimeFormat('en-US', options).format(date)Format numbers, currency, percentages, and units
new Intl.NumberFormat('en-US', options).format(number)Compare and sort strings with locale-specific rules
new Intl.Collator('de').compare(string1, string2)Determine plural category for numbers (one, few, many, other)
new Intl.PluralRules('en-US').select(count)See all Intl APIs in action
Built into JavaScript! No need for libraries like moment.js or numeral.js for internationalization.
Support 150+ locales out of the box
DateTimeFormat, NumberFormat, Collator, PluralRules
Built-in browser API, no libraries needed
Use navigator.language for user's locale