© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Peter Scheler
JS enthusiast
function add() { var args = Array.prototype.slice.call(arguments) return args.reduce(function(a, b) { return a + b }) } console.log(add(1, 2)) // 3 console.log(add(1, 2, 3, 4)) // 10
See here.
Faiyaz Shaikh
Programmer & Traveller (I think that's it..)
// before es2015 Array.prototype.slice.call(arguments) // es2015 Array.from(arguments) let args = [ ...arguments ]