Convert array to string in JavaScript
The toString() method since JavaScript 1.8.5 (ECMAScript 5) is generic and can be used with any object. The following is the syntax for the toString() method on an array:
Where:
- array: this is an array to convert to a string
Convert array to string with a separator between elements
To convert an array to a string using a separator between elements in JavaScript, you can use the array.join(separator) method: