I have an array as follows in javascript:
var linePoints = [[0, 3], [4, 8], [8, 5], [12, 13]];
But I would like to load this from a textfile instead of defining it in the code. The file:
input.txt:
0 3
4 8
8 5
12 13
I noticed this other post, which talks about something similar, but for a 1D array. I was wondering if there is a special function to do this for 2D. In java, I would read each line, then split it. But to be fair, I am new with javascript.