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 »const myArr = Int16Array.from([10,15,20,25,30,35,40,45,50]);
// Join the Array
let text = myArr.join(" ");
// 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 »const myArr = Int16Array.from([10,15,20,25,30,35,40,45,50]);
// Join the Array
let text = myArr.join("-");
Description
Thejoin() method returns the typed array as a string.
Thejoin() 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 supported in all browsers sinceJune 2017:
| Chrome 51 | Edge 15 | Firefox 54 | Safari 10 | Opera 38 |
| May 2016 | Apr 2017 | Jun 2017 | Sep 2016 | Jun 2016 |

