The Intl.getCanonicalLocales() method returns an array containing the canonical locale names. Duplicates will be omitted and elements will be validated as structurally valid language tags.
Intl.getCanonicalLocales()
MDN
Optional
A list of String values for which to get the canonical locale names
An array containing the canonical and validated locale names.
The
Intl.getCanonicalLocales()
method returns an array containing the canonical locale names. Duplicates will be omitted and elements will be validated as structurally valid language tags.MDN