I have functionWithManyArguments(arg1,...,arg15).
Can I log all arguments without having to enumerate them all?
I have functionWithManyArguments(arg1,...,arg15).
Can I log all arguments without having to enumerate them all?
Yes, You could do something like:-
function foo(...args) {
console.log(...args);
}
foo(1, 2, "a")
...args
are rest parameters.
© 2022 - 2024 — McMap. All rights reserved.
arguments
– Freckly