TypedArray.prototype.join()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It's been available across browsers since July 2015.
The join() method of TypedArray instances returns a new string that is the concatenation of all elements in this typed array, separated by commas or a specified separator string. If the typed array has only one item, that item's stringification is returned without using the separator. This method has the same algorithm as Array.prototype.join().
Try it
const uint8 = new Uint8Array([10, 20, 30, 40, 50]);
console.log(uint8.join());
// Expected output: "10,20,30,40,50"
console.log(uint8.join(""));
// Expected output: "1020304050"
console.log(uint8.join("-"));
// Expected output: "10-20-30-40-50"
Syntax
join() join(separator)
Parameters
-
separatorOptional - A string to separate each pair of adjacent elements of the typed array. If omitted, the typed array elements are separated with a comma (",").
Return value
A string with all typed array elements joined. If array.length is 0, the empty string is returned.
Description
See Array.prototype.join() for more details. This method is not generic and can only be called on typed array instances.
Examples
Using join()
const uint8 = new Uint8Array([1, 2, 3]);
uint8.join(); // '1,2,3'
uint8.join(" / "); // '1 / 2 / 3'
uint8.join(""); // '123'
Specifications
Browser compatibility
| Desktop | Mobile | Server | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on iOS | Samsung Internet | WebView Android | WebView on iOS | Bun | Deno | Node.js | |
join |
45 |
12 |
37 |
32 |
10 |
45 |
37 |
32 |
10 |
5.0 |
45 |
10 |
1.0.0 |
1.0 |
4.0.0 |
See also
- Polyfill of
TypedArray.prototype.joinincore-js - JavaScript typed arrays guide
TypedArrayTypedArray.prototype.toString()Array.prototype.join()String.prototype.split()
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join