...

/

Spread operator

Spread operator

Spread operator is used to expanding an expression where multiple arguments or multiple elements are required. We look at the use of spread operator in this lesson.

Suppose we have two arrays and we want to merge them together.

Console

With ... - spread operator we can do the same

Console

Looks cleaner to me but it isn't that impressive. However, let's do the same with objects:

Console

Seems ...

Access this course and 1200+ top-rated courses and projects.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy