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

176
Views
¿Cómo aplicar un método a una matriz/variable con la ayuda de un índice?

Estoy luchando con algo de alguna manera básico :)

Como puede ver en esta línea de código, uso un índice (i) para seleccionar un cierto valor dentro de una matriz:

 tiles[i].addChild(block);

y me gustaría poder hacer lo mismo, pero insertar algo en una matriz, en esta línea:

 tile0Content.push(block.identifier);

No sé cómo hacer esto, pero me imagino algo como esto (con i en lugar de 0):

 tileiContent.push(block.identifier);

Por supuesto, podría copiar y pegar manualmente mi código, pero es muy poco práctico + mi índice variará según las situaciones, por lo que sería muy MUY práctico poder insertar valores dentro de mis matrices usando un índice :)

Gracias a todos los que lean mi publicación <3

EDITAR: creo que mi publicación no es perfectamente clara sobre lo que quiero lograr, pero podría resumirlo así: en lugar de hacer:

 tile0Content.push(block.identifier); tile1Content.push(block.identifier); tile2Content.push(block.identifier);

Me gustaría hacer:

 for(var i = 0;i<myIndex.length;i++){ tileiContent.push(block.identifier); }
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!