Can a JavaScript function take unlimited arguments? Something like this:
testArray(1, 2, 3, 4, 5...);
I am trying:
var arr
With ECMAScript 6, you can use rest of arguments syntax:
const testArray = (...args) => { console.log(args); }; testArray(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);