Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
toLocaleString() は Object インスタンスのメソッドで、オブジェクトを表す文字列を返します。このメソッドは、ロケール固有の目的のために派生オブジェクトによってオーバーライドするためのものです。
なし。ただし、このメソッドをオーバーライドするすべてのオブジェクトは、 Number.prototype.toLocaleString のように locales と options に対応する最大 2 つの引数を受け取ることが期待されます。これらの引数の位置は、他の目的には使用しないでください。
this.toString() 呼び出しの返値です。
Object.prototype 継承するすべてのオブジェクト(つまり、 null プロトタイプオブジェクトを除くすべてのオブジェクト)は、 toLocaleString() メソッドを継承します。 Object's toLocaleString は、 this.toString() を呼び出した結果を返します。
この関数は、オブジェクトに汎用的な toLocaleString メソッドを提供するために用意されています。コア言語では、これらの組み込みオブジェクトは toLocaleString をオーバーライドしてロケール特有の書式設定を行います。
基底の toLocaleString() メソッドは、単純に toString() を呼び出します。
Array.prototype.toLocaleString()は、各要素の toLocaleString() メソッドを呼び出して、結果をロケール特有の区切り文字で連結することで、配列の値を文字列として出力するために使用されます。例を示します。
Date.prototype.toLocaleString() は、特定のロケールに適した日付表示を出力するために使用されます。例を示します。
Number.prototype.toLocaleString() は、特定のロケールに適した数値表示を出力するために使用されます。例を示します。
| ECMAScript® 2027 Language Specification # sec-object.prototype.tolocalestring |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年8月26日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.