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

302
Views
Aleatorizar elementos en una matriz en Typescript dando error: TypeError: 0 es de solo lectura

Tengo una matriz de objetos y me gustaría aleatorizar el orden de los elementos.

Así que tengo lo siguiente:

 const animals = data?.fetchAllAnimals; let randomizeAnimals = animals.sort(()=> Math.random() -0.5 )

Pero sigo recibiendo este error en Firefox: TypeError: 0 is read-only

y un error diferente en Chrome: TypeError: Cannot assign to read only property '0' of object '[object Array]'

¿Qué estoy haciendo mal aquí?

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!