JavaScript toString () method
Examples
The array is converted to a string:
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.toString();
fruits.toString();
fruits will output:
Banana,Orange,Apple,Mango
try it"
Definition and Usage
toString () method to the array to a string and returns the result.
Note: separated by commas between array elements.
Browser Support
All major browsers support toString ().
grammar
array.toString()
Return Value
Type | 描述 |
---|---|
String | 数组的所有值用逗号隔开 |
technical details
JavaScript version: | 1.1 |
---|