in the introduction to the replace ()
method of w3school, there is an example:
//
name = ""a", "b"";
name.replace(/"([^"]*)"/g, ""$1""); // "a", "b"
and replace it with the following abbreviation
name = ""a", "b"";
name.replace(/"/g, """); // "a", "b"
the effect is the same. If the latter can be realized, why use the former? Is it just to illustrate the use of $1
or is it beneficial?