此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。
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 2016年9月.
join() 方法将数组中所有元素连接为一个字符串。这个方法的算法和Array.prototype.join() 相同。TypedArray 是这里的类型化数组类型之一。
In this article
语法
js
join()join(separator)参数
separator可选。指定分隔每个元素的字符串。分隔符按需转换为字符串。如果没有,类型化数组的元素会以逗号 (",") 分隔。
返回值
所有元素连接后的字符串。
示例
js
var uint8 = new Uint8Array([1, 2, 3]);uint8.join(); // '1,2,3'uint8.join(" / "); // '1 / 2 / 3'uint8.join(""); // '123'规范
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-%typedarray%.prototype.join> |