xxxxxxxxxx
const res = await axios.post('https://httpbin.org/get', data, { params: { key: "your key" } });
xxxxxxxxxx
int total = Sum (1, 2, 3, 4);
Console.WriteLine (total); // 10
// The call to Sum above is equivalent to:
int total2 = Sum (new int[] { 1, 2, 3, 4 });
int Sum (params int[] ints)
{
int sum = 0;
for (int i = 0; i < ints.Length; i++)
sum += ints [i]; // Increase sum by ints[i]
return sum;
}
xxxxxxxxxx
static int SomarVarios(params int[] numeros)
{
int acumulador = 0;
foreach(int numero in numeros)
{
acumulador += numero;
}
return acumulador;
} Copiar código