function howMany(){ console.log(arguments); // } howMany(3,4,5,6,7,8,90,) //prints Arguments(7) [3, 4, 5, 6, 7, 8, 90, callee: (...), Symbol(Symbol.iterator): ƒ] // shows an array and we can do something like function howMany() { let total = 0; for (let value of arguments) { total += value; } console.log(total); return total; } howMany(3, 4, 5, 6, 7, 8, 90);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter