JavaScript Spread Operator
The spread operator, in simple terms, is a way to "spread" the contents of an array or object
The JavaScript spread operator is a way to expand an array or list into a concatenable type. This will make more sense after looking at a few examples and code snippets. If you do not understand arrays or lists within JavaScript please read this post first - Arrays and Lists in JavaScript
If we want to combine two arrays in JavaScript we can use the Concat function, which stands for concatenation. This function does not affect the arrays, it returns a new array with the combination of the two arrays. The 'result' variable in the code snippet below will contain an array with the number 1 through 10 inside.
<script>