JavaScript Array join()
Examples
// Create a Typed Array
const myArr = Int16Array.from([10,15,20,25,30,35,40,45,50]);
// Join the Array
let text = myArr.join(" ");
Try it Yourself »
// Create a Typed Array
const myArr = Int16Array.from([10,15,20,25,30,35,40,45,50]);
// Join the Array
let text = myArr.join("-");
Try it Yourself »
Description
The join()
method returns the typed array as a string.
The join()
method does not change the original array.
Any separator can be specified. The default is comma (,).
Syntax
typed-array.join(separator)
Parameters
Parameter | Description |
separator | Optional. The separator to be used. Default is a comma. |
Return Value
Type | Description |
A string. | The array values, separated by the specified separator. |
JavaScript Typed Arrays
Browser Support
typed-array.join()
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 |