JS Built-ins
StringString.prototype.concatbeginner

String.prototype.concat() β€” multiple strings

πŸ“– Usage Example
const str = 'Hello'
str.concat(', ', 'World', '!')   // β†’ 'Hello, World!'
''.concat('a', 'b', 'c')          // β†’ 'abc'

Use concat() to join two or more strings together, returning a new string without modifying the originals.

String.prototype.concat() β€” Multiple Arguments

.concat() accepts multiple arguments and joins them all.

Challenge: Implement joinAll(parts) that calls ''.concat(...parts).

joinAll(['Hello', ', ', 'World', '!']) // β†’ 'Hello, World!'
πŸ’‘ Hints (1)
  • β€’ Spread the array: `"".concat(...parts)`.