does rest params allocate array
function foo(a, b, ...rest) {
/*...*/
}
in example above its obvoius that array created, but what about this case
function foo(...rest) {
/*...*/
}
there rest
technicly the same as arguments
function foo() {
console.log.apply(null, arguments)
}
so, if i want avoid generate garbage could i prefer to use arguments
or not ?
also, does arguments
exists always or only when keyword used in function scope?
(if always, i assume thet using it is probably better, if not, is there any difference betwin rest and arguments
?)