jskatas.org Continuously Learn JavaScript. Your Way.

Spread operator: with strings

Spread syntax in use with strings.

Donate to NGO Julenka. Support Ukranians in need. Julenka is an NGO which my brother founded in 2011 to support Ukranian families and kids in need.

Spread syntax with strings

  • expands each character of a string by prefixing it with ...
  • expands any kind of character
  • works anywhere inside an array (must not be last)
  • don`t confuse with the rest operator
  • can also be used as function parameter


Syntax docs on MDN.