TypedArray.toString() function in JavaScript


The toString() function of the TypedArray object returns a string representing the contents of the typed array.

Syntax

Its Syntax is as follows

typedArray.toString();

Example

 Live Demo

<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>

Output

Contents of the typed array: 111,56,62,40,75,36,617,2,139,827

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 25-Jun-2020

25 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements