String.replace() is regexp-based; if you pass in a string as the first argument, the regexp made from it will not include the ‘g’ (global) flag. This option is essential if you want to replace all occurances of the search string (which is usually what you want).
An alternative non-regexp idiom for simple global string replace is:
function string_replace(haystack, find, sub) {
return haystack.split(find).join(sub);
}
This is preferable where the find string may contain characters that have an unwanted special meaning in regexps.
Anyhow, either method is fine for the example in the question.
alttext on the up arrow image says "This question is useful and clear..." which is a subjective matter. Now, if it said "This question is useful and clear to Ambassador Tomalak..." there might be grounds for your complaint.