Syntax error TypedArray.join() function in JavaScript

TypedArray.join() function in JavaScript



The join() function of the TypedArray object joins the contents of the typed array as single string and returns it. To this method you can pass a separator to separates the elements of the array.

Syntax

Its Syntax is as follows

typedArray.join(':')

Example

 Live Demo

<html>
<head>
   <title>JavaScript Array every Method</title>
</head>
<body>
   <script type="text/javascript">
      var int32View = new Int32Array([21, 19, 65, 21, 14, 66, 87, 55 ]);
      document.write("<br>");
      var contains = int32View.join('');
      document.write("."+contains);
      document.write("<br>");
      document.write(int32View.join(':'));
      document.write("<br>");
      document.write(int32View.join('-'));
      document.write("<br>");
      document.write(int32View.join(' '));
   </script>
</body>
</html>

Output

:
2119652114668755
21:19:65:21:14:66:87:55
21-19-65-21-14-66-87-55
21 19 65 21 14 66 87 55
Updated on: 2020-06-25T13:23:10+05:30

58 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements