Typed Array toLocaleString()
Examples
// Create a Typed Array
const myArr = Int16Array.from([1000,1500,2000,2500,3000]);
// Convert to locale string
let text = myArr.toLocaleString();
Try it Yourself »
Description
The toLocaleString()
method returns the array elements using their toLocaleString method.
Syntax
typed-array.toLocaleString(locale, options)
Parameters
Parameter | Description |
locale | Optional. A string with a BCP 47 language. |
options | Optional. An object with configuration properties. |
Return Value
Type | Description |
String | All array elements decoded to locale strings. |
JavaScript Typed Arrays
Browser Support
typed-array.toLocaleString()
is an ECMAScript6 (ES6 2015) feature.
JavaScript 2015 is fully supported in all modern browsers since June 2017:
Chrome 51 | Edge 15 | Firefox 54 | Safari 10 | Opera 38 |
May 2016 | Apr 2017 | Jun 2017 | Sep 2016 | Jun 2016 |