demo · v131

Intl.Locale getters become methods

Pick a locale. The left column reads the deprecated synchronous getters and the right reads the new method form. Both return the same data today, but only the methods will work after the deprecation window.

deprecated getters

replacement methods

captured deprecation warning stream

the api

const l = new Intl.Locale("ar-EG");
// Old (deprecated): plain property access
l.calendars;          // ["gregory", "coptic", ...]
// New (preferred): explicit method
l.getCalendars();     // ["gregory", "coptic", ...]

see also