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 four

In the above example, a space is used as a separator.

Last updated

Was this helpful?