Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
Using the spread operator on Iterable gives `Array [ Array Iterator ]`

We recently moved our react project over to nx, and in the process, something weird is now happening with spread operators. I am doing the following

[...Array(someNumber).keys()]

which should give [0,1,2,...,someNumber-1] however when I log the result I get Array [ Array Iterator ]

I have had the same problems when I try and do [...someMap.entries()].

I suspected it might be a problem with Babel, but have tried using both @babel/plugin-transform-spread and @babel/plugin-proposal-object-rest-spread with no luck. We are using the following presets in our react app

"presets": [
    [
      "@nrwl/react/babel",
      {
        "runtime": "automatic"
      }
    ]
  ]

Also, I don't know if this is related, but now we also get an error when using someString.replace saying Uncaught TypeError: someString.replace is not a function

Does anyone know what is causing this problem?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda