is 6 The sum of [1 2 3 4] is 10 In Java As with C#, the type in Java is available as a catch-all. public class Program { // Variadic methods store any additional arguments they receive in an array. // Consequentially, `printArgs` is actually a method with one parameter: a // variable-length array of `String`s. private static void printArgs(String... strings) { for (String string : strings) { System.out.println(string); } } public static void main(String[] args) { printArgs("hello"); // short for printArgs(["hello"]) printArgs("hello", "world"); // short for printArgs(["hello", "world"]) } } In JavaScript JavaScript does not care about types of variadic arguments. function sum(...numbers) { return numbers.reduce((a, b) => a + b, 0); } console.log(sum(1, 2, 3)); // 6 console.log(sum(3, 2)); // 5 console.log(sum()); // 0 It's also possible to create a variadic function using the arguments object, although it is only usable with functions created with the keyword. function sum() { return Array.prototype.reduce.call(arguments, (a, b) => a + b, 0); } console.log(sum(1, 2, 3)); // 6 console.log(sum(3, 2)); // 5 console.log(sum()); // 0 In Lua Lua functions may pass varargs to other functions the same way as other values using the keyword. tables can be passed into variadic functions by using, in Lua version 5.2 or higher , or Lua 5.1 or lower . Varargs can be used as a table by constructing a table with the vararg as a value.function sum(...) --... designates varargs local sum=0 for _,v in pairs({...}) do --creating a table with a varargs is the same as creating one with standard values sum=sum+v end return sum end values={1,2,3,4} sum(5,table.unpack(values)) --returns 15. table.unpack should go after any other arguments, otherwise not all values will be passed into the function. function add5(...) return ...+5 --this is incorrect usage of varargs, and will only return the first value provided end entries={} function process_entries() local processed={} for i,v in pairs(entries) do processed[i]=v --placeholder processing code end return table.unpack(processed) --returns all entries in a way that can be used as a vararg end print(process_entries()) --the print function takes all varargs and writes them to stdout separated by newlines In Pascal Pascal has four built-in procedures which are defined as variadic, which, because of this special condition, are intrinsic to the compiler. These are the , , , and procedures. However, there are alternate specifications allowing for default arguments to procedures or functions which make them work variadically, as