replace all
Javascript replace() is used with regular expression "\g" in order to replace all the occurrences of a string.