for (const [head, ...tail] of array) { const head = 1; let tail; console.log(tail); console.log(head); }