Easy JavaScript Part 2: What Is the Rest Parameter in a Function?

A JavaScript function can take any number of parameters. Unlike other languages like C# and Java, you can pass any number of parameters while calling a JavaScript function. JavaScript functions allow an unknown number of function parameters. Before ECMAScript 6, JavaScript had a variable to access these unknown or variable numbers of parameters, which is an array-like object but not an array. Consider this code to understand the arguments variable:
function add(){

var result = 0;
for(let i=0;i

Link: https://dzone.com/articles/easy-javascript-part-2-what-is-the-rest-parameter?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev