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 ...
maybe the code was only for three line CSVs