function head(first, ...rest) { return [first, rest.length]; } console.log(head("a", "b", "c", "d"));