The first time you call getArrayFromCSV it reads lines until it gets to the end of the file. The second time around it's already at the end of the file, so there are no more lines to read.
You can fix this either by reopening the file before each call, or by refactoring your function to pull out all the data you need in one pass.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The first time you call getArrayFromCSV it reads lines until it gets to the end of the file. The second time around it's already at the end of the file, so there are no more lines to read.
You can fix this either by reopening the file before each call, or by refactoring your function to pull out all the data you need in one pass.