Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

130
Vistas
Use ConstructorParameters to create utility for various JavaScript API static methods

I'm reading this question & answer, trying to understand why I'm getting the same error even if I've done almost the same.

My original code.

/**
 * Shortcut for `Array.from()` static method.
 * @param  {...any[]} args array-like value
 * @returns {Array}
 */
const ArrayFrom = (...args) => Array.from(...args);
//                                     >>ERROR here
export default ArrayFrom;
A spread argument must either have a tuple type or be passed to a rest parameter.ts(2556)

Now after defining with ConstructorParameters

/**
 * Shortcut for `Array.from()` static method.
 * @param  {ConstructorParameters<typeof Array>} args array-like value
 * @returns {Array}
 */
const ArrayFrom = (...args) => Array.from(...args);
//                                     >>SAME ERROR here
export default ArrayFrom;

I get the same error, at the same expression. Can anyone please explain?

about 4 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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda