Combine elements of an array into a string, optionally using a separator.
Source Code
let fruits = ['apple', 'banana', 'cherry'];
let result = fruits.join(', ');
console.log(result); // "apple, banana, cherry"
Combine elements of an array into a string, optionally using a separator.
let fruits = ['apple', 'banana', 'cherry'];
let result = fruits.join(', ');
console.log(result); // "apple, banana, cherry"