I am reading in a text file where I know what each line of the file is.
For example, the first line is a starting coordinate pair that is in the format {"x":9,"y":9} and the second line is a end coordinate pair.
There exists global variable var startCoord = {"x": startX, "y": startY};
How can I pull the x and y from the file to set as the new startCoord.x and startCoord.y respectively?
JSFiddle here
Example of text file:
{"x":9,"y":9}
{"x":4,"y":104}
{"x":124,"y":51}
{"x":92,"y":65}
{"x":113,"y":31}