WEBVTT

1
00:00:00.000 --> 00:00:01.660
And a spread operator that quickly
builds and manipulates arrays.

2
00:00:01.660 --> 00:00:05.970
Rest parameters and spread operators
look similar because they share the same

3
00:00:05.970 --> 00:00:10.740
three dot syntax, but both are quite
different when closely examined.

4
00:00:10.740 --> 00:00:14.640
A rest parameter collects
the arguments passed to a function,

5
00:00:14.640 --> 00:00:19.150
while a spread operator expands
an array or any type of expression.

6
00:00:19.150 --> 00:00:22.580
So first,
let's look at what a rest parameter is.

7
00:00:22.580 --> 00:00:25.910
You can follow along using the latest
workspace by opening the workspace for

8
00:00:25.910 --> 00:00:26.448
this video.

9
00:00:26.448 --> 00:00:30.000
The file rest-parameters.js has
a simple function named myFunction.
