This page was translated from English by the community.Learn more and join the MDN Web Docs community.
TypedArray.prototype.toString()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2017년 1월.
TypedArray 인스턴스의toString() 메서드는 명시된 형식화 배열과 배열의 요소를 표현하는 문자열을 반환합니다. 이 메서드는Array.prototype.toString()과 같은 알고리즘을 가집니다.
In this article
시도해 보기
const uint8 = new Uint8Array([10, 20, 30, 40, 50]);const uint8String = uint8.toString();console.log(uint8String.startsWith("10"));// Expected output: true구문
js
toString()매개변수
없음.
반환 값
해당 형식화 배열을 표현하는 문자열.
설명
좀 더 많은 정보는Array.prototype.toString()을 참고하시기 바랍니다. 이 메서드는 범용적이지 않으며, 형식화 배열 인스턴스에서만 호출됩니다.
예제
>형식화 배열을 문자열로 변환하기
js
const uint8 = new Uint8Array([1, 2, 3]);// 명시적 변환console.log(uint8.toString()); // 1,2,3// 암시적 변환console.log(`${uint8}`); // 1,2,3명세서
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-%typedarray%.prototype.tostring> |