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

211
Views
How do you concatenate space between an array of arrays inside a map array?

Hello I want to know how do you format correctly a Multi-Array (An array of arrays) that is already inside of a map array (I'll try to be more brief this time).

Having this piece of code:

const [gradosData, setGradosData] = useState([])
const agregarComa = (grado, index) => {
        console.log(grado, index)
        console.log(grado[index])
    }

{productos.map((productos, index) => ( 

<td>{productos.grado}</td>

))

It looks like this:

enter image description here

I was thinking on making a function that will get the value of the array + index of the array and then let it do for each array of length map productos then copy each in another array value eee but got stuck this is what the console is printing (is printing the right values so I'm kind of in the right path)

enter image description here

THIS is what I want to achieve:

enter image description here

I think I sum it up pretty good let me know if requires something else

I just want to add a coma + space to make it look better

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

0

In your function agregarComa and console.log, the argument grado seems to be an array of strings. If you want to join these strings with a comma and a space you can simply to this:

grado.join(", ") // will return "4° Grado, 5° Grado, 6° Grado"

Arrays have a built-in join method in JavaScript, and you can check it out here.

Also in your jsx code, this should suffice to achieve your goal:

<td>{productos.grado.join(", ")}</td>
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!