`toLocaleString()` 方法返回一个该对象的字符串表示。此方法被用于派生对象为了特定语言环境的目的（locale-specific purposes）而重载使用。

## 语法

    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) Object.prototype.toLocaleString | Standard |
ECMAScript 2015 (6th Edition, ECMA-262) Object.prototype.toLocaleString | Standard |
ECMAScript Latest Draft (ECMA-262) Object.prototype.toLocaleString | Draft |

## 浏览器兼容性

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
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | Safari on iOS | Samsung Internet | Node.js
`toLocaleString` | Chrome Full support Yes | Edge Full support 12 | Firefox Full support 1 | IE Full support Yes | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Edge Mobile Full support Yes | Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes | nodejs Full support Yes

### Legend

Full support
  Full support

## 相关链接

- `Object.prototype.toString()`