CSVToArray will return an empty item for documents ending with \n
chepo92 opened this issue · 2 comments
chepo92 commented
https://github.com/30-seconds/30-seconds-of-code/blob/master/snippets/CSVToArray.md
CSVToArray('a,b\nc,d\n'); // [ [ 'a', 'b' ], [ 'c', 'd' ], [ '' ] ]
Drisya-Ponmari commented
The same problem will arise if the document is starting with \n as well.
chepo92 commented
Answerig myself, .filter(Boolean)
will get rid of them, getting those nulls/empty may sometimes be the intended behaviour.