Categories
JavaScript Answers

How to convert JavaScript array to string?

Spread the love

Sometimes, we want to convert JavaScript array to string.

In this article, we’ll look at how to convert JavaScript array to string.

How to convert JavaScript array to string?

To convert JavaScript array to string, we can use the array join method.

For instance, we write

const arr = ["A", "B", "C"];
const arrString = arr.join(", ");

to call arr.join to combine the strings in arr with each entry separated by commas.

Conclusion

To convert JavaScript array to string, we can use the array join method.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *