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

318
Vistas
What is the TypeScript definition of a matrix defined with nester Array.fill

Any hints on what the correct TypeScript definition for this would be? Basically a 5x5 matrix with empty strings.

const arr = Array(5).fill(Array(5).fill('', 0), 0)

What I tried so far is:

const arr: Array<Array<string>> = Array(5).fill(Array(5).fill('', 0), 0)

but I get Unsafe assignment of type any[] to a variable of type string[][].

One hint I have from VSCode (mouse over the Array definition) is this:

var Array: ArrayConstructor (arrayLength?: number | undefined) => any[] (+2 overloads)

Does this mean that using ArrayConstructor I need to find a way to define the return value?

Any help would be appreciated.

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