Parameters: This method accepts single parameter as mentioned above and described below:
- locales: This parameter holds a list of string values for which to get the canonical locale names.
Return value: This method returns an array containing the canonical locale names.
Array ["en-US"] Array ["en-US", "fr"] RangeError: Incorrect locale information provided
Array ["en-US"] Array ["en-US", "fr"] Array ["tr", "ut"]
Supported Browsers: The browsers supported by Intl.getCanonicalLocales() method are listed below:
- Google Chrome