EN
JavaScript - convert array to string
0
points
In this article, we would like to show you how to convert array to string in JavaScript.
1. Using toString()
method
In this example, we use toString()
method to convert the letters
array to string.
// ONLINE-RUNNER:browser;
const letters = ['A', 'B', 'C'];
const result = letters.toString();
console.log(result); // A,B,C
2. Using join()
method
In this example, we use join()
method to convert the letters
array to string.
// ONLINE-RUNNER:browser;
const letters = ['A', 'B', 'C'];
const result = letters.join('');
console.log(result); // ABC