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.