Replace characters in string array Javascript
Strings are immutable, so you just have to re-assign their value:
vertices[x] = vertices[x].replace('v ', '');
Should be
vertices[x]=vertices[x].replace('v ', '');
Because replace returns value, and doesn't change initial string.