I defined and populated an array called vertices . I can print the output in the JavaScript console as shown below:
["v 2.11733 0.0204144 1.0852", "v 2.12303 0.0131256 1.08902", "v 2.12307 0.0131326 1.10733" ...etc. ]
However, I want to remove the "v" character from each item. I tried this using the .replace() function as shown below:
var x; for(x = 0; x < 10; x++) { vertices[x].replace('v ', ''); }
After printing the array to the console after this code, I see the same result as before, with 'v still present. Can someone tell me how to solve this?
source share