Okay so i’m thoroughly confused. In the ES6 section of JavaScript we learn about the spread operator. Which I assume is the “…” with a following name value.
Am I right in assuming spread is primarily used for placing an array in a functions parameters when the function expects something different from an array?.
and is rest primarily used in destructuring assignment to encompass the remaining indexes of an array
e.g const [a,b, …rest] = [0, 1 , 2 , 3 , 4 , 5 , 6]?
I’m mainly confused as they share the same syntax of “…” ? am I close or way off ? thanks in advance.