Categories
JavaScript Answers

How to use .join method to convert array to string without commas with JavaScript?

Spread the love

Sometimes, we want to use .join method to convert array to string without commas with JavaScript.

In this article, we’ll look at how to use .join method to convert array to string without commas with JavaScript.

How to use .join method to convert array to string without commas with JavaScript?

To use .join method to convert array to string without commas with JavaScript, we call it with an empty string.

For instance, we write

const s = arr.join("")

to call join on the arr array with an empty string to join the strings in arr without commas.

Conclusion

To use .join method to convert array to string without commas with JavaScript, we call it with an empty string.

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 *