--- title: Object.prototype.toLocaleString() slug: Web/JavaScript/Reference/Global_Objects/Object/toLocaleString tags: - JavaScript - Method - Object - Prototype - Reference translation_of: Web/JavaScript/Reference/Global_Objects/Object/toLocaleString ---
{{JSRef}}

toLocaleString() 메서드는 객체로 된 문자열을 반환합니다. 이 메서드는 지역별로 다른 객체로 재정의되어 표시됩니다.

{{EmbedInteractiveExample("pages/js/object-prototype-tolocalestring.html")}}

구문

obj.toLocaleString()

반환 값

객체를 나타내는 문자열.

설명

{{jsxref("Object")}}의 toLocaleString은 {{jsxref("Object.toString", "toString()")}}을 호출 한 결과를 반환합니다.

이 함수는 모든 객체가 사용할 수는 없지만 객체에 일반 toLocaleString 메소드를 제공하기 위해 제공됩니다. 아래 목록을 참조하십시오.

toLocaleString()을 재정의하는 객체

명세

Specification Status Comment
{{SpecName('ES3')}} {{Spec2('ES3')}} Initial definition.
{{SpecName('ES5.1', '#sec-15.2.4.3', 'Object.prototype.toLocaleString')}} {{Spec2('ES5.1')}}  
{{SpecName('ES6', '#sec-object.prototype.tolocalestring', 'Object.prototype.toLocaleString')}} {{Spec2('ES6')}}  
{{SpecName('ESDraft', '#sec-object.prototype.tolocalestring', 'Object.prototype.toLocaleString')}} {{Spec2('ESDraft')}}  

브라우저 호환성

{{Compat("javascript.builtins.Object.toLocaleString")}}

같이 보기