I have a string that contains coordinates and some whitesace:
E.G. "SM10,10 50,50 20,10\nFM10,20 30,40"
I'd like to extract the list of coordinates:
["10,10", "50,50", "20,10", "10,20", "30,40"]
And then perform some transform (let's say scale by 5) and produce a resultant string:
"SM50,50 250,250 100,50\nFM50,100 140,200"
What's the most performant way to perform this transformation in JavaScript?