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

170
Views
Obtener todas las combinaciones entre arreglos

Tengo este código que intenta devolver una matriz con todas las combinaciones posibles entre dos o más matrices. Pero tengo este problema.

 getCombn(arr: string | any[], pre?: string | undefined) { pre = pre || ' '; if (!arr.length) { return pre; } var ans = arr[0].reduce(function (ans: string | any[], value: string | any) { return ans.concat(getCombn(arr.slice(1), pre + value));} , []); this.uesa.innerHTML = arr; return ans; }

"No se puede encontrar el nombre 'getCombn'".

¿Qué estoy haciendo mal?

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

0

parece que olvidó agregar this cuando llama a su función de forma recursiva.

intente modificar su línea return ans.concat(getCombn(arr.slice(1), pre + value));}

para return ans.concat(this.getCombn(arr.slice(1), pre + value));}

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!