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

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 25-Jun-2020

25 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements