• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

235
Vistas
How to iterate through a Parameters tuples in TypeScript

How do you iterate though the TestParams tuple? I know that you can access it by index. But I want to go through each parameter type using iteration. Like a for

function auxFunction(arg1: number, arg2: string, arg3: boolean): string {
       return arg1 + arg2;
}

type TestParams = Parameters<typeof auxFunction>;

Notice that if I use the following line it shows an error: 'i' refers to a value, but is being used as a type here. Did you mean 'typeof i'?

let i = 0;
type ParamType = TestParams[i];
about 3 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda