Languages
[Edit]
EN

JavaScript - convert array to string

0 points
Created by:
Zayyan-Todd
560

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'];
let 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'];
let result = letters.join('');

console.log(result); // ABC

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