Javascript
Just use the arguments object:
function foo() {
for (var i = 0; i < arguments.length; i++) {
console.log(arguments[i]);
}
}
foo(111, 222, 333, 444);
// expected output:
// 111
// 222
// 333
// 444
In (most) recent browsers, you can accept variable number of arguments with this syntax:
function foo() {
console.log(...arguments);
}
foo(111, 222, 333, 444);
// expected output: 111 222 333 444