Join
The join method, makes an array turn into a string and joins it all together. It does not change the original array.
let array = ["one", "two", "three", "four"];
console.log(array.join(" "));
// Result: one two three fourAny separator can be specified but the default one is a comma (,).
In the above example, a space is used as a separator.
Last updated
Was this helpful?