What does ES6’s spread operator (…) do and what can you use it for?

Some language features are easy to guess what they do even if you’re unfamiliar with them, but it’s not immediately obvious what the ES6 spread operator ‘…’ does.

Here’s a great article that gives some practical examples of how you can use the spread operator, for example, to:

  • insert one array into another
  • copy the contents of an array
  • convert a String into an array of chars

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.