Languages
[Edit]
EN

JavaScript - convert array to string

0 points
Created by:
Zayyan-Todd
830

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

Alternative titles

  1. JavaScript - convert list to string
  2. JavaScript - convert array into comma separated string
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript - String (popular problems)

JavaScript - convert array to string
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join