JavaScript toString() Method
Complete Array Object Reference
Definition and Usage
The toString() method converts an array to a string and returns the result.
Syntax
Tips and Notes
Note: The elements in the array will be separated with commas.
Example
In this example we will create an array and convert it to a string:
<script type="text/javascript">
var arr = new Array(3);
arr[0] = "Jani";
arr[1] = "Hege";
arr[2] = "Stale";
document.write(arr.toString());
</script>
|
The output of the code above will be:
Try-It-Yourself Demos
toString()
How to use toString() to convert an array to a string.
Complete Array Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|