When I've studied the code given by my professor, I found a line that I do not quite understand.
The code is like this:
textclean = textclean.replace(/ your /g," ");
I think the meaning is to replace your
with a space so we can delete it by split(" ")
; but what is the meaning of /g
?
Why can't we use:
textclean = textclean.replace(your, " ");