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

338
Views
Why am I getting error in row.join() function?

I'm trying to generate a csv file using the next code.

function generaBlue() {
  var taula = $("#divTaula")[0].childNodes;

  var id = taula[0].getAttribute("id");
  console.log(id.substr(0, id.indexOf("_")));
  let table = $("#" + id.substr(0, id.indexOf("_"))).DataTable();
  let data = table.rows().data();
  let text = "";
  data.map((row) => (text += row.join(";") + "\n"));
  let blob = new Blob([text], { type: "text/csv;charset=utf-8" });
  saveAs(blob, "prova.csv");
}

And row.join(';') is returning this error:

TypeError: row.join is not a function

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

0

The problem was that I was receiving an array of objects that do not accept the join function.

function generaBlue() {
  var taula = $("#divTaula")[0].childNodes;

  var id = taula[0].getAttribute("id");
  console.log(id.substr(0, id.indexOf("_")));
  let table = $("#" + id.substr(0, id.indexOf("_"))).DataTable();
  let data = table.rows().data();
 let text = data.reduce((a, c) => a  + Object.values(c).join(";") + "\n", "");
  let blob = new Blob([text], { type: "text/csv;charset=utf-8" });
  saveAs(blob, "prova.csv");
}
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!