What the docs at Mozilla says:
console.log((function(...args) {}).length); // 0, rest parameter is not counted console.log((function(a, b = 1, c) {})
Not sure if this answers what you were asking... based on your examples though...
var x = function (...args) { //console.log(Object.keys(args).length); //console.log(Object.keys(arguments).length); console.log(arguments.length); }
https://jsfiddle.net/hxm4smc1/555/