ฟังก์ชัน toString() ของวัตถุ TypedArray ส่งกลับสตริงที่แสดงเนื้อหาของอาร์เรย์ที่พิมพ์
ไวยากรณ์
ไวยากรณ์ของมันคือดังต่อไปนี้
typedArray.toString();
ตัวอย่าง
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var typedArray = new Int32Array([111, 56, 62, 40, 75, 36, 617, 2, 139, 827 ]);
var result = typedArray.toString();
document.write("Contents of the typed array: "+result);
</script>
</body>
</html> ผลลัพธ์
Contents of the typed array: 111,56,62,40,75,36,617,2,139,827