MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 참여해서 번역을 마치도록 도와 주세요!
English (US)의 문서도 읽어보세요.

The toLocaleUpperCase() method returns the calling string value converted to upper case, according to any locale-specific case mappings.

Syntax

str.toLocaleUpperCase()
str.toLocaleUpperCase(locale) 
str.toLocaleUpperCase([locale, locale, ...])

Parameters

locale Optional
The locale parameter indicates the locale to be used to convert to upper case according to any locale-specific case mappings. If multiple locales are given in an Array, the best available locale is used. The default locale is the host environment’s current locale.

Return value

A new string representing the calling string converted to upper case, according to any locale-specific case mappings.

Exceptions

  • A RangeError ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag.
  • A TypeError ("invalid element in locales argument") is thrown if an array element isn't of type string.

Description

The toLocaleUpperCase() method returns the value of the string converted to upper case according to any locale-specific case mappings. toLocaleUpperCase() does not affect the value of the string itself. In most cases, this will produce the same result as toUpperCase(), but for some locales, such as Turkish, whose case mappings do not follow the default case mappings in Unicode, there may be a different result.

Examples

Using toLocaleUpperCase()

'alphabet'.toLocaleUpperCase(); // 'ALPHABET'

'i\u0307'.toLocaleUpperCase('lt-LT'); // 'I' 

let locales = ['lt', 'LT', 'lt-LT', 'lt-u-co-phonebk', 'lt-x-lietuva']; 
'i\u0307'.toLocaleUpperCase(locales); // 'I'

Specifications

Specification Status Comment
ECMAScript 3rd Edition (ECMA-262) Standard Initial definition. Implemented in JavaScript 1.2.
ECMAScript 5.1 (ECMA-262)
The definition of 'String.prototype.toLocaleUpperCase' in that specification.
Standard  
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'String.prototype.toLocaleUpperCase' in that specification.
Standard  
ECMAScript Latest Draft (ECMA-262)
The definition of 'String.prototype.toLocaleUpperCase' in that specification.
Draft  
ECMAScript Internationalization API 4.0 (ECMA-402)
The definition of 'String.prototype.toLocaleUpperCase' in that specification.
Draft ES Intl 2017 added the locale parameter.

Browser compatibility

FeatureChromeFirefoxEdgeInternet ExplorerOperaSafari
Basic Support(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
locale?55????
FeatureAndroidChrome for AndroidEdge mobileFirefox for AndroidIE mobileOpera AndroidiOS Safari
Basic Support(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
locale???55???

See also

문서 태그 및 공헌자

 이 페이지의 공헌자: fscholz, jameshkramer, eduardoboucas, Mingun, Sheppy, Norbert, evilpie, Brettz9
 최종 변경: fscholz,