JavaScript Basics
JavaScript Objects
JavaScript Advanced
JS Useful References
JS Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM
|
Javascript Array toString() Method
Description:
Javascript array toString() method returns a string representing the source code of the specified array and its elements.
Syntax:
Here is the detail of parameters:
Return Value:
Returns a string representing the array.
Example:
<html>
<head>
<title>JavaScript Array toString Method</title>
</head>
<body>
<script type="text/javascript">
var arr = new Array("orange", "mango", "banana", "sugar");
var str = arr.toString();
document.write("Returned string is : " + str );
</script>
</body>
</html>
|
This will produce following result:
Returned string is : orange,mango,banana,sugar
|
To understand it in better way you can Try it yourself.
|
|
|