join()
noun
say it: “JOYN” /dʒɔɪn/
A JavaScript array method that glues the items of an array into one string, with the separator you choose between them, such as ', '.
What does join() do in JavaScript?
join() — Glues a list of strings into one string with a separator between them.
const words = "tea coffee".split(" ");
const label = words.join(" & ");
In a sentence
- “toppings.join(', ') turned the list into 'cheese, olives, basil' for the order summary.”
Level: Apprentice · More JavaScript terms at this level
Updated