P粉6701076612023-08-17 10:52:42
It does seem pointless. You need to ask the author of the code what their intentions are in this regard, and they should at least leave a comment.
However, there is actually a slight difference: the remaining parameters do not count towards the function's number of parameters. Therefore, (function(bar){}).length
is 1
and (function(...[bar]){}).length
is 0
.