--

Hello and sure!

No, they get named through the array destructuring, and it is items that are being destructured. Maybe this clarifies it:

const arr = [1, 2, 3];

const [first, ...rest] = arr;

first // = 1

rest // = [2, 3]

--

--

Esbjörn Blomquist
Esbjörn Blomquist

Written by Esbjörn Blomquist

Software architect and developer with web and functional JavaScript close to his heart. Worked many years with web solutions mainly within the IoT field.

No responses yet