So this is really getting on my nerves. I needed to explain this a bit better so here it is. I\'m trying to make my script log in google\'s console a specific way. I\'ve got
Your code was almost there, but what you were logging to the console was ridiculous, since it was just the points attribute, unmodified
So, something like this
const polylines = Array.from(xmlDoc.getElementsByTagName('polyline'));
const Lines = polylines.map(pl => pl.getAttribute('points').split(' ').map(pair => pair.split(',').map(Number)));
Lines.forEach(line => console.log(JSON.stringify(line)));
Or, given that the second argument to Array.from is a map function, you can further simplify the code to
const Lines = Array.from(xmlDoc.getElementsByTagName('polyline'), pl => pl.getAttribute('points').split(' ').map(pair => pair.split(',').map(Number)));
Lines.forEach(line => console.log(JSON.stringify(line)));
Note, the console.log is done AFTER the processing
as for the comment
Lines.forEach(line => {
// here you can post each line to whatever you need
});