Javascript Array - toString method


The toString() method takes the elements of the array amd converts them into an array. The elements are separated by commas.

Take a look at the following example


<html>
<body>

<script type="text/javascript">
var x = [1,"two",3,"Four",5,6,7,8,9,10];

var y = x.toString();
document.writeln(y + '<br />');  // outputs:1,two,3,Four,5,6,7,8,9,10

</script>

</body>
</html>



Try this example online here .



               
`1 qaZ