Example 1 — Head and Tail
Name the first argument, rest gets the remainder.
function describe(first, ...rest) {
return first + " +" + rest.length + " more";
}
console.log(describe("a", "b", "c")); How It Works
- First named.
firstis"a". - Rest array.
restis["b", "c"].
