Performance: Rest parameters
LOW IMPACT
Rest parameters affect JavaScript function call performance and bundle size, impacting initial load and interaction responsiveness.
function sum(...args) { return args.reduce((a, b) => a + b, 0); }
function sum() { var args = Array.prototype.slice.call(arguments); return args.reduce((a, b) => a + b, 0); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using arguments object with slice | 0 | 0 | 0 | [X] Bad |
| Using rest parameters | 0 | 0 | 0 | [OK] Good |