JavaScript 2025 · Strings

Split and join

Turn a string into an array, and back again.

const words = "a,b,c".split(",");
const line = words.join(" | ");

Official JavaScript 2025 documentation

More strings commands

All strings commands · JavaScript 2025 cheatsheet

Was this page helpful?