What is array toString JavaScript
In this article, i will go to explain array toString() in JavaScript.
Array toString() in JavaScript
The JavaScript array toString method converts an array into a string.
Syntax of toString method
It has no parameter.
Return value of toString method
tostring method returns a string representing the array.
Example of toString method
<!DOCTYPE html>
<html>
<head>
<title>JavaScript Array toString Method</title>
</head>
<body>
<script type="text/javascript">
var val = new Array("one", "two", "three","four");
var retstr = val.toString();
document.write("Returned string is : " + retstr );
</script>
</body>
</html>
|
Output:
Ask Your Question
Got a programming related question? You may want to post your question here