ES6 JS has nice syntax for calculating with lists:
let [car, ...cdr] = [1,2,3]
car, *cdr = [1, 2, 3, 4]
let [car, cdr @ ..] = [1,2,3];
ES6 JS has nice syntax for calculating with lists:
After the above 'car' has value 1 and 'cdr' has value [2,3].