toLocaleString() 메서드는 객체로 된 문자열을 반환합니다. 이 메서드는 지역별로 다른 객체로 재정의되어 표시됩니다.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
구문
obj.toLocaleString()
반환 값
객체를 나타내는 문자열.
설명
Object의 toLocaleString은 toString()을 호출 한 결과를 반환합니다.
이 함수는 모든 객체가 사용할 수는 없지만 객체에 일반 toLocaleString 메소드를 제공하기 위해 제공됩니다. 아래 목록을 참조하십시오.
toLocaleString()을 재정의하는 객체
Array:Array.prototype.toLocaleString()Number:Number.prototype.toLocaleString()Date:Date.prototype.toLocaleString()
명세
| Specification | Status | Comment |
|---|---|---|
| ECMAScript 3rd Edition (ECMA-262) | Standard | Initial definition. |
| ECMAScript 5.1 (ECMA-262) The definition of 'Object.prototype.toLocaleString' in that specification. |
Standard | |
| ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Object.prototype.toLocaleString' in that specification. |
Standard | |
| ECMAScript (ECMA-262) The definition of 'Object.prototype.toLocaleString' in that specification. |
Living Standard |
브라우저 호환성
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
toLocaleString | Chrome Full support 1 | Edge Full support 12 | Firefox Full support 1 | IE Full support 5.5 | Opera Full support 4 | Safari Full support 1 | WebView Android Full support 1 | Chrome Android Full support 18 | Firefox Android Full support 4 | Opera Android Full support 10.1 | Safari iOS Full support 1 | Samsung Internet Android Full support 1.0 | nodejs Full support Yes |
Legend
- Full support
- Full support