JS Built-ins
← Array203 / 226
ArrayArray.prototype.toStringbeginner

Convert String Array to String

πŸ“– Usage Example
const words = ['hello', 'world']
words.toString()  // β†’ 'hello,world'

Use toString() for a quick comma-joined string when a simple representation is enough.

Array.prototype.toString β€” String Arrays

toString works on arrays of any type, not just numbers. It joins all elements with commas.

Implement stringArrayToString which returns the comma-separated string representation of a string array.

πŸ’‘ Hints (2)
  • β€’ Call arr.toString() directly β€” it works the same way for strings
  • β€’ The result is always a plain string, not an array