Simple Javascript Replace Not Working
This seems so simple and trivial but it is not working. Here is my javascript: var url = '/computers/'; console.log(url); url.replace(/\//gi, ' '); console.log(url); And here is t
Solution 1:
url = url.replace(/\//gi, " ");
Solution 2:
Nothing changes because you're not assigning the result of the replacement to a variable. Add url = url.replace()
Post a Comment for "Simple Javascript Replace Not Working"