Solution Review: Rest & Spread Syntax

In this lesson, we will discuss the solutions to the questions in the previous lesson.

Solution 1 #

Did you find this helpful?

Explanation #

Rest follows the same syntax as the spread syntax, i.e., placing three dots ... before what we choose to copy. However, the difference lies in the purpose. Where spread is used to create copies of arrays/objects, rest is used to collect all the remaining values into an ...

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.