⬅️ Execute Program Modern JavaScript

Rest params

function f(...args) {
  return args;
}
f('a', 'b');
 
// Result:
['a', 'b']
  • In other languages, you may see it called “varargs”, which stands for “VARiable number of ARGuments”.