Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

278
Vistas
can't understand some javascript code : javascript

I am newbie in javascript and i need some help please my goal is to convert a csv file to an ofx , I have found an open source and i want to understand it to modify it as my requirements,

this is the function in javascript:

  // csv to ofx
  function convert(csvData, filename) {
  
    csvData = csvData.split('\n').map(row => row.trim())
  
    csvDataInfoRow1 = csvData[0].split(';');
    csvDataInfoRow2 = csvData[1].split(';');
    csvDataInfoRow4 = csvData[3].split(';');
  
    // the date at the end of the period
    let dateEnd = csvDataInfoRow1[3].substr(csvDataInfoRow1[3].length - 10).split('/');
    // the date at the beginning of the period
    let dateBeginning = csvDataInfoRow1[2].substr(csvDataInfoRow1[2].length - 10).split('/');

My Question is why the programmer add just 3 variables:

csvDataInfoRow1 = csvData[0].split(';');
csvDataInfoRow2 = csvData[1].split(';');
csvDataInfoRow4 = csvData[3].split(';');

and not more or less varibles like that , what i mean for example why he just stopped in csvDataInfoRow4 = csvData[3].split(';') and what he want to do by this instruction !; also why for example he did'nt complete another variable like : csvDataInfoRow5 = csvData[4].split(';') and so on ...

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

maybe the code was only for three line CSVs

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda