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

139
Views
¿Cómo evito que la forma matemática aleatoria seleccione el mismo valor dos veces?

 var navne = ["peter", "mads", "Per"] var randomNavn = navne[Math.floor(Math.random() * navne.length)]; var spørgsmål = [`bund din drink ${randomNavn}`, `tag 2 shots ${randomNavn}`, `del 2 tåre ud ${randomNavn}`] var randomItem = spørgsmål[Math.floor(Math.random() * spørgsmål.length)]; function næsteSpørgsmål() { if (!spørgsmål.length) { for (var i = 0; i < 50; i++) { spørgsmål.push(i); } var val = spørgsmål[index] randomItem.splice(randomItem, 1); console.log(randomItem) return val; } } console.log(næsteSpørgsmål());

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

la mejor manera de lograr esto es eliminar el elemento seleccionado de la matriz.

 // generate random index let randomIndex = Math.floor(Math.random() * spørgsmål.length) // get item at the generated index let randomItem = spørgsmål[randomIndex] // remove item from array, so it can't be selected again spørgsmål.splice(randomIndex, 1)
about 4 years ago · Juan Pablo Isaza Report
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!