Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!