Description:
Javascript array toString() method returns a string representing the source code of the specified array and its elements.
Syntax:
array.toString(); |
Here is the detail of parameters:
- NA
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 |
No comments:
Post a Comment