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