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.
In this example, we use toString()
method to convert the letters
array to string.
xxxxxxxxxx
1
const letters = ['A', 'B', 'C'];
2
const result = letters.toString();
3
4
console.log(result); // A,B,C
In this example, we use join()
method to convert the letters
array to string.
xxxxxxxxxx
1
const letters = ['A', 'B', 'C'];
2
const result = letters.join('');
3
4
console.log(result); // ABC