The join() method of Array instances creates and returns a new string by concatenating all of the elements in this array, separated by commas or a specified separator string. If the array has only one item, then that item will be returned without using the separator.

How do I join array elements in JavaScript?

const elements = ['Value 1', 'Value 2', ‘Value 3'];

console.log(elements.join());
// Output: "Value 1,Value 2,Value 3"

0
2023-08-23
JavaScript
0
0
2023-08-23
JavaScript
0
0

Contact Us

If you have any inquiries or feedback, please don't hesitate to reach out to us at [email protected]. We will respond to your request as soon as possible. Thank you very much for your interest!

Country profiles